1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2024-12-14 11:57:51 +00:00

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.
This commit is contained in:
Markus Lehtonen 2020-09-03 12:12:13 +03:00
parent 4e5df73747
commit 799da7cbb9
2 changed files with 8 additions and 14 deletions

View file

@ -1,20 +1,10 @@
steps: steps:
- name: gcr.io/cloud-builders/docker - name: gcr.io/k8s-testimages/gcb-docker-gcloud:v20200824-5d057db
args: entrypoint: scripts/test-infra/push-image.sh
- 'build' env:
- '--build-arg=VERSION=$_GIT_TAG' - IMAGE_EXTRA_TAG_NAMES=$_PULL_BASE_REF
- '--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'
- '.'
substitutions: substitutions:
_GIT_TAG: '0.0.0' _GIT_TAG: '0.0.0'
_PULL_BASE_REF: 'master' _PULL_BASE_REF: 'master'
options: options:
substitution_option: ALLOW_LOOSE 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'

View file

@ -0,0 +1,4 @@
#!/bin/bash -e
make image -e
make push -e