2019-06-02 06:09:26 +00:00
|
|
|
steps:
|
|
|
|
- name: 'gcr.io/cloud-builders/git'
|
|
|
|
args: ['fetch', '--all', '--unshallow']
|
|
|
|
- name: 'gcr.io/cloud-builders/bazel'
|
|
|
|
args: ['build', ':gopath']
|
|
|
|
- name: 'gcr.io/cloud-builders/docker'
|
|
|
|
args: ['build', '-t', 'gcr.io/$PROJECT_ID/go-branch', '-f', 'cloudbuild/go.Dockerfile', '.']
|
|
|
|
- name: 'gcr.io/$PROJECT_ID/go-branch'
|
|
|
|
args: ['tools/go_branch.sh']
|
|
|
|
- name: 'gcr.io/cloud-builders/git'
|
|
|
|
args: ['checkout', 'go']
|
|
|
|
- name: 'gcr.io/cloud-builders/git'
|
|
|
|
args: ['clean', '-f']
|
|
|
|
- name: 'golang'
|
|
|
|
args: ['go', 'build', './...']
|
|
|
|
- name: 'gcr.io/cloud-builders/git'
|
|
|
|
entrypoint: 'bash'
|
|
|
|
args:
|
|
|
|
- '-c'
|
2019-06-04 01:04:43 +00:00
|
|
|
- 'if [[ "$BRANCH_NAME" == "master" ]]; then git push "${_ORIGIN}" go:go; fi'
|
|
|
|
substitutions:
|
|
|
|
_ORIGIN: origin
|