Skip to content

Commit

Permalink
Merge pull request #2686 from chrischdi/pr-ci-not-always-upload
Browse files Browse the repository at this point in the history
🌱 e2e: only upload images to gcs if we run tests which need it
  • Loading branch information
k8s-ci-robot authored Feb 2, 2024
2 parents 187cd63 + ff8b233 commit 41a6da3
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions hack/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,19 @@ wait_for_ipam_reachable

make envsubst

# Save the docker image locally
make e2e-image
mkdir -p /tmp/images
docker save gcr.io/k8s-staging-capi-vsphere/cluster-api-vsphere-controller:dev -o "$DOCKER_IMAGE_TAR"

# Store the image on gcs
login
E2E_IMAGE_SHA=$(docker inspect --format='{{index .Id}}' gcr.io/k8s-staging-capi-vsphere/cluster-api-vsphere-controller:dev)
export E2E_IMAGE_SHA
gsutil cp ${DOCKER_IMAGE_TAR} gs://capv-ci/"$E2E_IMAGE_SHA"
# Only build and upload the image if we run tests which require it to save some $.
if [[ -z "${GINKGO_FOCUS+x}" ]]; then
# Save the docker image locally
make e2e-image
mkdir -p /tmp/images
docker save gcr.io/k8s-staging-capi-vsphere/cluster-api-vsphere-controller:dev -o "$DOCKER_IMAGE_TAR"

# Store the image on gcs
login
E2E_IMAGE_SHA=$(docker inspect --format='{{index .Id}}' gcr.io/k8s-staging-capi-vsphere/cluster-api-vsphere-controller:dev)
export E2E_IMAGE_SHA
gsutil cp ${DOCKER_IMAGE_TAR} gs://capv-ci/"$E2E_IMAGE_SHA"
fi

# Run e2e tests
make e2e

0 comments on commit 41a6da3

Please sign in to comment.