From 799da7cbb9fafb705e21ca54ba4aacabae96268b Mon Sep 17 00:00:00 2001 From: Markus Lehtonen Date: Thu, 3 Sep 2020 12:12:13 +0300 Subject: [PATCH] cloudbuild.yaml: build using make Use make for building our container image (through a new push-image.sh script) instead of building directly with docker. This way we avoid the container image tag naming hassle where we build and push the image on "image-pushing" prow job and need to be able to reliably re-create the same tag on the "testing" side for end-to-end tests. This also has the advantage that the same mechanism (make) is used everywhere, i.e. in image-pushing, testing and locally. --- cloudbuild.yaml | 18 ++++-------------- scripts/test-infra/push-image.sh | 4 ++++ 2 files changed, 8 insertions(+), 14 deletions(-) create mode 100755 scripts/test-infra/push-image.sh diff --git a/cloudbuild.yaml b/cloudbuild.yaml index 059309619..ae61534cc 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -1,20 +1,10 @@ steps: - - name: gcr.io/cloud-builders/docker - args: - - 'build' - - '--build-arg=VERSION=$_GIT_TAG' - - '--build-arg=HOSTMOUNT_PREFIX=/host-' - - '--tag=gcr.io/$PROJECT_ID/node-feature-discovery:$_GIT_TAG' - - '--tag=gcr.io/$PROJECT_ID/node-feature-discovery:$_PULL_BASE_REF' - - '--tag=gcr.io/$PROJECT_ID/node-feature-discovery:$_PULL_BASE_REF-g$COMMIT_SHA' - - '.' + - name: gcr.io/k8s-testimages/gcb-docker-gcloud:v20200824-5d057db + entrypoint: scripts/test-infra/push-image.sh + env: + - IMAGE_EXTRA_TAG_NAMES=$_PULL_BASE_REF substitutions: _GIT_TAG: '0.0.0' _PULL_BASE_REF: 'master' options: substitution_option: ALLOW_LOOSE -# Pust images -images: - - 'gcr.io/$PROJECT_ID/node-feature-discovery:$_GIT_TAG' - - 'gcr.io/$PROJECT_ID/node-feature-discovery:$_PULL_BASE_REF' - - 'gcr.io/$PROJECT_ID/node-feature-discovery:$_PULL_BASE_REF-g$COMMIT_SHA' diff --git a/scripts/test-infra/push-image.sh b/scripts/test-infra/push-image.sh new file mode 100755 index 000000000..71a46dfa6 --- /dev/null +++ b/scripts/test-infra/push-image.sh @@ -0,0 +1,4 @@ +#!/bin/bash -e + +make image -e +make push -e