Skip to content

Commit

Permalink
Merge pull request #1 from jeanmalves/develop
Browse files Browse the repository at this point in the history
Etapa de build da imagem do app no CI
  • Loading branch information
jeanmalves committed Jul 6, 2020
2 parents 76f972c + a5ea17b commit fb825c0
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 4 deletions.
9 changes: 9 additions & 0 deletions Dockerfile
@@ -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"]
29 changes: 25 additions & 4 deletions cloudbuild.yaml
@@ -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}'

0 comments on commit fb825c0

Please sign in to comment.