Skip to content

Commit

Permalink
Use docker build for e2e image
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandr Demicev <alexandr.demicev@suse.com>
  • Loading branch information
alexander-demicev committed Dec 3, 2024
1 parent 66f8227 commit ee97e59
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
11 changes: 2 additions & 9 deletions .github/workflows/run-e2e-suite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,18 +90,11 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build and push e2e image
if: ${{ inputs.MANAGEMENT_CLUSTER_ENVIRONMENT == 'eks' }}
run: CACHE_DIR=/tmp/.buildx-cache make e2e-image-push
run: make e2e-image-push
- name: Run e2e tests
run: CACHE_DIR=/tmp/.buildx-cache make test-e2e
run: make test-e2e
- name: Collect run artifacts
if: always()
uses: actions/upload-artifact@v4
Expand Down
19 changes: 13 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -592,16 +592,23 @@ test-e2e-push-image: $(GINKGO) $(HELM) $(CLUSTERCTL) kubectl e2e-image-push
$(E2E_RUN_COMMAND)

.PHONY: e2e-image
e2e-image: $(CACHE_DIR) ## Build the image for e2e tests
ADDITIONAL_COMMANDS=$(CACHE_COMMANDS) TAG=v0.0.1 CONTROLLER_IMAGE_NAME=turtles-e2e $(MAKE) docker-build
RELEASE_TAG=v0.0.1 CONTROLLER_IMG=$(REGISTRY)/$(ORG)/turtles-e2e \
e2e-image: ## Build the image for e2e tests
CONTROLLER_IMG=$(REGISTRY)/$(ORG)/turtles-e2e $(MAKE) e2e-image-build
RELEASE_TAG=$(TAG) CONTROLLER_IMG=$(REGISTRY)/$(ORG)/turtles-e2e \
CONTROLLER_IMAGE_VERSION=v0.0.1 \
$(MAKE) build-chart

.PHONY: e2e-image-build
e2e-image-build: ## Build the image for e2e tests
docker build \
--build-arg builder_image=$(GO_CONTAINER_IMAGE) \
--build-arg goproxy=$(GOPROXY) \
--build-arg package=. \
--build-arg ldflags="$(LDFLAGS)" . -t $(CONTROLLER_IMG):v0.0.1

.PHONY: e2e-image-push
e2e-image-push: $(CACHE_DIR) ## Push the image for e2e tests
TARGET_PLATFORMS=$(ARCH) TAG=v0.0.1 CONTROLLER_IMAGE_NAME=turtles-e2e \
ADDITIONAL_COMMANDS=$(CACHE_COMMANDS) $(MAKE) docker-build-and-push
e2e-image-push: ## Push the image for e2e tests
docker push $(CONTROLLER_IMG):v0.0.1

.PHONY: compile-e2e
e2e-compile: ## Test e2e compilation
Expand Down

0 comments on commit ee97e59

Please sign in to comment.