Skip to content

Commit

Permalink
Simplify image building
Browse files Browse the repository at this point in the history
Signed-off-by: Connor Catlett <[email protected]>
  • Loading branch information
ConnorJC3 committed Jul 5, 2024
1 parent 9389271 commit 5ce3d81
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
10 changes: 4 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ endif

GO_SOURCES=go.mod go.sum $(shell find pkg cmd -type f -name "*.go")

REGISTRY?=gcr.io/k8s-staging-provider-aws
IMAGE?=$(REGISTRY)/aws-ebs-csi-driver
TAG?=$(GIT_COMMIT)

ALL_OS?=linux windows
ALL_ARCH_linux?=amd64 arm64
ALL_OSVERSION_linux?=al2023
Expand Down Expand Up @@ -100,8 +96,7 @@ update: update/gofmt update/kustomize update/mockgen update/gomod update/shfmt u
verify: verify/govet verify/golangci-lint verify/update
@echo "All verifications passed!"

.PHONY: all-push
all-push: all-image-registry push-manifest


.PHONY: cluster/create
cluster/create: bin/kops bin/eksctl bin/aws bin/gomplate
Expand Down Expand Up @@ -187,6 +182,9 @@ update-sidecar-dependencies: update-truth-sidecars generate-sidecar-tags update/
## CI aliases
# Targets intended to be executed mostly or only by CI jobs

.PHONY: all-push
all-push: all-image-registry push-manifest

.PHONY: all-push-with-a1compat
all-push-with-a1compat: sub-image-linux-arm64-al2 all-image-registry push-manifest

Expand Down
5 changes: 1 addition & 4 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,8 @@
timeout: 5400s
steps:
- name: gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20240523-a15ad90fc9
entrypoint: ./hack/prow.sh
entrypoint: ./hack/cloudbuild.sh
env:
- GIT_TAG=${_GIT_TAG}
- PULL_BASE_REF=${_PULL_BASE_REF}
- REGISTRY_NAME=gcr.io/${_STAGING_PROJECT}
- HOME=/root
substitutions:
_STAGING_PROJECT: "k8s-staging-provider-aws"
2 changes: 1 addition & 1 deletion hack/prow.sh → hack/cloudbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ loudecho "Set up QEMU"
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes

loudecho "Push manifest list containing amazon linux and windows based images to GCR"
export REGISTRY=$REGISTRY_NAME
export IMAGE=gcr.io/k8s-staging-provider-aws/aws-ebs-csi-driver
export TAG=$GIT_TAG
export VERSION=$PULL_BASE_REF
IMAGE=gcr.io/k8s-staging-provider-aws/aws-ebs-csi-driver make -j $(nproc) all-push-with-a1compat
2 changes: 2 additions & 0 deletions hack/e2e/build-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ function build_and_push() {
export ALL_ARCH_linux="${IMAGE_ARCH}"
fi
make -j $(nproc) all-push

loudecho "Image pushed to ${IMAGE_NAME}:${IMAGE_TAG}"
}

if [[ "${CREATE_MISSING_ECR_REPO}" == true ]]; then
Expand Down

0 comments on commit 5ce3d81

Please sign in to comment.