From 56ea6bbfe06aab1d2d54a92739b5c24241cac9df Mon Sep 17 00:00:00 2001 From: Christopher Hoskin Date: Tue, 27 Aug 2019 09:21:52 +0100 Subject: [PATCH 1/4] First attempt at cloudbuild --- cloudbuild.yaml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 cloudbuild.yaml diff --git a/cloudbuild.yaml b/cloudbuild.yaml new file mode 100644 index 00000000..0e9d890e --- /dev/null +++ b/cloudbuild.yaml @@ -0,0 +1,24 @@ +steps: +- name: 'mirror.gcr.io/library/golang' + entrypoint: make + args: ['format'] +- name: 'mirror.gcr.io/library/golang' + entrypoint: make + args: ['build'] +- name: 'mirror.gcr.io/library/golang' + entrypoint: make + args: ['test'] +- name: docker + args: [ + 'build', + '-t', 'gcr.io/$PROJECT_ID/stackdriver-prometheus-sidecar:${TAG_NAME}${BRANCH_NAME}', + '-t', 'gcr.io/$PROJECT_ID/stackdriver-prometheus-sidecar:${SHORT_SHA}', + '.' + ] +images: [ + 'gcr.io/$PROJECT_ID/stackdriver-prometheus-sidecar:${TAG_NAME}${BRANCH_NAME}', + 'gcr.io/$PROJECT_ID/stackdriver-prometheus-sidecar:${SHORT_SHA}' +] +options: + diskSizeGb: 200 + machineType: 'N1_HIGHCPU_8' From 56c01336d83ef89ef93bb4a29829023c168f4326 Mon Sep 17 00:00:00 2001 From: Christopher Hoskin Date: Tue, 27 Aug 2019 09:53:51 +0100 Subject: [PATCH 2/4] Add missing tags --- cloudbuild.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cloudbuild.yaml b/cloudbuild.yaml index 0e9d890e..da87aacf 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -12,11 +12,13 @@ steps: args: [ 'build', '-t', 'gcr.io/$PROJECT_ID/stackdriver-prometheus-sidecar:${TAG_NAME}${BRANCH_NAME}', + '-t', 'gcr.io/$PROJECT_ID/stackdriver-prometheus-sidecar:${TAG_NAME}${BRANCH_NAME}-${SHORT_SHA}', '-t', 'gcr.io/$PROJECT_ID/stackdriver-prometheus-sidecar:${SHORT_SHA}', '.' ] images: [ 'gcr.io/$PROJECT_ID/stackdriver-prometheus-sidecar:${TAG_NAME}${BRANCH_NAME}', + 'gcr.io/$PROJECT_ID/stackdriver-prometheus-sidecar:${TAG_NAME}${BRANCH_NAME}-${SHORT_SHA}', 'gcr.io/$PROJECT_ID/stackdriver-prometheus-sidecar:${SHORT_SHA}' ] options: From f57510b3793194c232152ff0884c284eec5ddb0d Mon Sep 17 00:00:00 2001 From: Christopher Hoskin Date: Mon, 9 Sep 2019 18:57:53 +0100 Subject: [PATCH 3/4] Add indent --- cloudbuild.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cloudbuild.yaml b/cloudbuild.yaml index da87aacf..2b75c798 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -22,5 +22,5 @@ images: [ 'gcr.io/$PROJECT_ID/stackdriver-prometheus-sidecar:${SHORT_SHA}' ] options: - diskSizeGb: 200 - machineType: 'N1_HIGHCPU_8' + diskSizeGb: 200 + machineType: 'N1_HIGHCPU_8' From 7a9cb61de4131513ef752bdc4bae6eca83ff7fb9 Mon Sep 17 00:00:00 2001 From: Christopher Hoskin Date: Mon, 9 Sep 2019 18:59:19 +0100 Subject: [PATCH 4/4] Add disclaimer to cloud build config --- cloudbuild.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cloudbuild.yaml b/cloudbuild.yaml index 2b75c798..a990d4df 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -1,3 +1,6 @@ +# This config is provided for development/testing purposes only. +# The official Docker image of stackdriver-prometheus-sidecar is not built +# using this config. steps: - name: 'mirror.gcr.io/library/golang' entrypoint: make