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 #1 from jeanmalves/develop
Etapa de build da imagem do app no CI
- Loading branch information
Showing
2 changed files
with
34 additions
and
4 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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM golang:1.14 | ||
|
||
COPY src/ /go/src/ | ||
|
||
WORKDIR /go/src/github.com/jeanmalves/operation/app | ||
|
||
RUN go install | ||
|
||
ENTRYPOINT ["/go/bin/app"] |
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,6 +1,27 @@ | ||
substitutions: | ||
VERSION: 0.1.0 | ||
|
||
steps: | ||
- id: "Rodando teste add_test" | ||
name: "gcr.io/cloud-builders/go" | ||
args: ["test", "github.com/jeanmalves/operation/addition"] | ||
env: ["GOPATH=."] | ||
|
||
- id: "Gerando imagem" | ||
name: 'gcr.io/cloud-builders/docker' | ||
args: | ||
- 'build' | ||
- '--build-arg' | ||
- 'version=${VERSION}' | ||
- '-t' | ||
- 'gcr.io/$PROJECT_ID/golang-ci-app:latest' | ||
- '-t' | ||
- 'gcr.io/$PROJECT_ID/golang-ci-app:${VERSION}' | ||
- '.' | ||
|
||
- name: 'gcr.io/$PROJECT_ID/golang-ci-app' | ||
args: ['version'] | ||
|
||
- id: "Rodando teste add_test" | ||
name: "gcr.io/cloud-builders/go" | ||
args: ["test", "github.com/jeanmalves/operation/addition"] | ||
env: ["GOPATH=."] | ||
images: | ||
- 'gcr.io/$PROJECT_ID/golang-ci-app:latest' | ||
- 'gcr.io/$PROJECT_ID/golang-ci-app:${VERSION}' |