mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
test images: Use PULL_BASE_SHA for non-git image building
In the test image build jobs, the image-util.sh script is not being run in a git repository, which causes git log to fail. In this case, we can use the PULL_BASE_SHA set in cloudbuild.yaml instead.
This commit is contained in:
parent
cbb5ea8210
commit
00dd02f89c
@ -14,8 +14,8 @@ steps:
|
|||||||
dir: ./test/images/
|
dir: ./test/images/
|
||||||
env:
|
env:
|
||||||
- DOCKER_CLI_EXPERIMENTAL=enabled
|
- DOCKER_CLI_EXPERIMENTAL=enabled
|
||||||
- TAG=$_GIT_TAG
|
|
||||||
- BASE_REF=$_PULL_BASE_REF
|
- BASE_REF=$_PULL_BASE_REF
|
||||||
|
- GIT_COMMIT_ID=$_PULL_BASE_SHA
|
||||||
- WHAT=$_WHAT
|
- WHAT=$_WHAT
|
||||||
- REGISTRY=$_REGISTRY
|
- REGISTRY=$_REGISTRY
|
||||||
# The default cloudbuild has HOME=/builder/home and docker buildx is in /root/.docker/cli-plugins/docker-buildx
|
# The default cloudbuild has HOME=/builder/home and docker buildx is in /root/.docker/cli-plugins/docker-buildx
|
||||||
@ -40,6 +40,8 @@ substitutions:
|
|||||||
# _PULL_BASE_REF will contain the ref that was pushed to to trigger this build -
|
# _PULL_BASE_REF will contain the ref that was pushed to to trigger this build -
|
||||||
# a branch like 'master' or 'release-0.2', or a tag like 'v0.2'.
|
# a branch like 'master' or 'release-0.2', or a tag like 'v0.2'.
|
||||||
_PULL_BASE_REF: 'master'
|
_PULL_BASE_REF: 'master'
|
||||||
|
# _PULL_BASE_SHA will contain the git SHA from which the image will be built from.
|
||||||
|
_PULL_BASE_SHA: '12345'
|
||||||
# _REGISTRY will contain the staging registry.
|
# _REGISTRY will contain the staging registry.
|
||||||
_REGISTRY: 'gcr.io/k8s-staging-e2e-test-images'
|
_REGISTRY: 'gcr.io/k8s-staging-e2e-test-images'
|
||||||
# _WHAT will contain the image name to be built and published to the staging registry.
|
# _WHAT will contain the image name to be built and published to the staging registry.
|
||||||
|
@ -36,7 +36,9 @@ source "${KUBE_ROOT}/hack/lib/util.sh"
|
|||||||
# Mapping of go ARCH to actual architectures shipped part of multiarch/qemu-user-static project
|
# Mapping of go ARCH to actual architectures shipped part of multiarch/qemu-user-static project
|
||||||
declare -A QEMUARCHS=( ["amd64"]="x86_64" ["arm"]="arm" ["arm64"]="aarch64" ["ppc64le"]="ppc64le" ["s390x"]="s390x" )
|
declare -A QEMUARCHS=( ["amd64"]="x86_64" ["arm"]="arm" ["arm64"]="aarch64" ["ppc64le"]="ppc64le" ["s390x"]="s390x" )
|
||||||
|
|
||||||
GIT_COMMIT_ID=$(git log -1 --format=%h)
|
# NOTE(claudiub): In the test image build jobs, this script is not being run in a git repository,
|
||||||
|
# which would cause git log to fail. Instead, we can use the GIT_COMMIT_ID set in cloudbuild.yaml.
|
||||||
|
GIT_COMMIT_ID=$(git log -1 --format=%h || echo "${GIT_COMMIT_ID}")
|
||||||
windows_os_versions=(1809 2004 20H2)
|
windows_os_versions=(1809 2004 20H2)
|
||||||
declare -A WINDOWS_OS_VERSIONS_MAP
|
declare -A WINDOWS_OS_VERSIONS_MAP
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user