-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from AirHelp/feature/go-mod-Jenkinsfile
AIR-25385 Add jenkinsfile and migrate from dep to go mod
- Loading branch information
Showing
8 changed files
with
93 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
FROM golang:1.10-alpine | ||
FROM golang:1.11-alpine | ||
ENV GO111MODULE=on | ||
ENV CGO_ENABLED=0 | ||
|
||
WORKDIR /go/src/github.com/AirHelp/treasury | ||
RUN apk add --no-cache git && go get github.com/golang/dep/cmd/dep | ||
WORKDIR /usr/src/app | ||
|
||
RUN apk add --no-cache git | ||
|
||
COPY go.mod go.sum ./ | ||
RUN go mod download | ||
|
||
# copies the Gopkg.toml and Gopkg.lock to WORKDIR | ||
COPY Gopkg.toml Gopkg.lock ./ | ||
# install the dependencies without checking for go code | ||
RUN dep ensure -v -vendor-only | ||
COPY . . | ||
CMD ["go", "test", "-cover", "-v", "./..."] |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!groovy | ||
|
||
def label = "treasury-${UUID.randomUUID().toString()}" | ||
|
||
podTemplate(label: label, containers: [ | ||
containerTemplate( | ||
name: 'golang', | ||
image: 'golang:1.11-alpine', | ||
ttyEnabled: true, | ||
command: 'cat', | ||
resourceRequestCpu: '100m', | ||
resourceRequestMemory: '128Mi', | ||
envVars: [ | ||
envVar(key: 'GO111MODULE', value: 'on'), | ||
envVar(key: 'CGO_ENABLED', value: '0'), | ||
] | ||
) | ||
]) { | ||
node(label) { | ||
stage('github checkout') { | ||
checkout scm | ||
} | ||
|
||
stage('download Go deps') { | ||
container('golang'){ | ||
sh 'apk add --no-cache git' | ||
sh 'go mod download' | ||
} | ||
} | ||
|
||
stage('go test') { | ||
container('golang'){ | ||
sh 'go test -cover -v ./...' | ||
} | ||
} | ||
|
||
stage('go formatting') { | ||
container('golang'){ | ||
sh 'gofmt -s -w .' | ||
} | ||
} | ||
|
||
stage('go vet') { | ||
container('golang'){ | ||
sh 'go vet -v ./...' | ||
} | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module github.com/AirHelp/treasury | ||
|
||
require ( | ||
github.com/aws/aws-sdk-go v1.16.2 | ||
github.com/inconshreveable/mousetrap v1.0.0 // indirect | ||
github.com/spf13/cobra v0.0.3 | ||
github.com/spf13/pflag v1.0.3 // indirect | ||
github.com/stretchr/testify v1.3.0 // indirect | ||
golang.org/x/net v0.0.0-20190206173232-65e2d4e15006 // indirect | ||
golang.org/x/text v0.3.0 // indirect | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
github.com/aws/aws-sdk-go v1.16.2 h1:nlD5jfFLa/EN/Ag1B2UAI2YtE0oFSN+YJWh1uicKGss= | ||
github.com/aws/aws-sdk-go v1.16.2/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= | ||
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= | ||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= | ||
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= | ||
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= | ||
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM= | ||
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= | ||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= | ||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= | ||
github.com/spf13/cobra v0.0.3 h1:ZlrZ4XsMRm04Fr5pSFxBgfND2EBVa1nLpiy1stUsX/8= | ||
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= | ||
github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= | ||
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= | ||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= | ||
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= | ||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= | ||
golang.org/x/net v0.0.0-20190206173232-65e2d4e15006 h1:bfLnR+k0tq5Lqt6dflRLcZiz6UaXCMt3vhYJ1l4FQ80= | ||
golang.org/x/net v0.0.0-20190206173232-65e2d4e15006/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= | ||
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= | ||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters