summaryrefslogtreecommitdiffhomepage
path: root/cloudbuild
diff options
context:
space:
mode:
authorKevin Krakauer <krakauer@google.com>2019-06-12 15:21:22 -0700
committerKevin Krakauer <krakauer@google.com>2019-06-12 15:21:22 -0700
commit0bbbcafd68154e7c7b46692b84a39fb6bb5f1568 (patch)
treed8fba01ad76900715665b0418a786de2d77e2a05 /cloudbuild
parent06a83df533244dc2b3b8adfc1bf0608d3753c1d9 (diff)
parent70578806e8d3e01fae2249b3e602cd5b05d378a0 (diff)
Merge branch 'master' into iptables-1-pkg
Change-Id: I7457a11de4725e1bf3811420c505d225b1cb6943
Diffstat (limited to 'cloudbuild')
-rw-r--r--cloudbuild/go.Dockerfile2
-rw-r--r--cloudbuild/go.yaml22
2 files changed, 24 insertions, 0 deletions
diff --git a/cloudbuild/go.Dockerfile b/cloudbuild/go.Dockerfile
new file mode 100644
index 000000000..226442fd2
--- /dev/null
+++ b/cloudbuild/go.Dockerfile
@@ -0,0 +1,2 @@
+FROM ubuntu
+RUN apt-get -q update && apt-get install -qqy git rsync
diff --git a/cloudbuild/go.yaml b/cloudbuild/go.yaml
new file mode 100644
index 000000000..a38ef71fc
--- /dev/null
+++ b/cloudbuild/go.yaml
@@ -0,0 +1,22 @@
+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'
+ - 'if [[ "$BRANCH_NAME" == "master" ]]; then git push "${_ORIGIN}" go:go; fi'
+substitutions:
+ _ORIGIN: origin