k8s.io/kubernetes@v1.29.3/test/images/cloudbuild.yaml (about) 1 # See https://cloud.google.com/cloud-build/docs/build-config 2 3 # this must be specified in seconds. If omitted, defaults to 600s (10 mins) 4 # the timeout was increased because some images might take longer to build (e.g.: sample-apiserver, pets/redis-installer) 5 timeout: 5400s 6 # this prevents errors if you don't use both _GIT_TAG and _PULL_BASE_REF, 7 # or any new substitutions added in the future. 8 options: 9 substitution_option: ALLOW_LOOSE 10 machineType: 'N1_HIGHCPU_8' 11 steps: 12 - name: 'gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20230623-56e06d7c18' 13 entrypoint: 'bash' 14 dir: ./test/images/ 15 env: 16 - DOCKER_CLI_EXPERIMENTAL=enabled 17 - BASE_REF=$_PULL_BASE_REF 18 - GIT_COMMIT_ID=$_PULL_BASE_SHA 19 - WHAT=$_WHAT 20 - REGISTRY=$_REGISTRY 21 # The default cloudbuild has HOME=/builder/home and docker buildx is in /root/.docker/cli-plugins/docker-buildx 22 # We need to set the HOME to /root explicitly since we're using docker buildx 23 - HOME=/root 24 # NOTE(claudiub): we need to call register.sh before creating and bootstraping a docker buildx instance. 25 args: 26 - '-c' 27 - | 28 gcloud auth configure-docker \ 29 && ../../third_party/multiarch/qemu-user-static/register/register.sh --reset -p yes \ 30 && export DOCKER_CLI_EXPERIMENTAL=enabled \ 31 && docker version \ 32 && docker buildx version \ 33 && docker buildx create --name img-builder --use \ 34 && docker buildx inspect --bootstrap \ 35 && make all-build-and-push 36 substitutions: 37 # _GIT_TAG will be filled with a git-based tag for the image, of the form vYYYYMMDD-hash, and 38 # can be used as a substitution 39 _GIT_TAG: '12345' 40 # _PULL_BASE_REF will contain the ref that was pushed to to trigger this build - 41 # a branch like 'master' or 'release-0.2', or a tag like 'v0.2'. 42 _PULL_BASE_REF: 'master' 43 # _PULL_BASE_SHA will contain the git SHA from which the image will be built from. 44 _PULL_BASE_SHA: '12345' 45 # _REGISTRY will contain the staging registry. 46 _REGISTRY: 'gcr.io/k8s-staging-e2e-test-images' 47 # _WHAT will contain the image name to be built and published to the staging registry. 48 _WHAT: 'all-conformance'