Skip to content

Commit

Permalink
fix makefile
Browse files Browse the repository at this point in the history
Signed-off-by: Mohamed Mahmoud <[email protected]>
  • Loading branch information
msherif1234 committed May 22, 2023
1 parent d99e5a4 commit e918482
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/push_image_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ env:
REGISTRY: quay.io/netobserv
IMAGE: network-observability-console-plugin
ORG: netobserv
VERSION: temp

jobs:
push-pr-image:
Expand Down Expand Up @@ -40,7 +39,7 @@ jobs:
- name: build and push images
run: IMAGE_ORG=${{ env.ORG }} IMAGE=${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ env.short_sha }} make images
- name: build and push manifest
run: IMAGE_ORG=${{ env.ORG }} VERSION=${{ env.VERSION }} make ci-manifest
run: IMAGE_ORG=${{ env.ORG }} IMAGE=${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ env.short_sha }} make ci-manifest
- uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
Expand Down
13 changes: 10 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ IMAGE_SHA = $(IMAGE_TAG_BASE):$(BUILD_SHA)

# Image building tool (docker / podman)
OCI_BIN_PATH = $(shell which podman || which docker)
OCI_BIN ?= $(shell v='$(OCI_BIN_PATH)'; echo "$${v##*/}")
OCI_BIN ?= $(shell basename ${OCI_BIN_PATH})

GOLANGCI_LINT_VERSION = v1.50.1
NPM_INSTALL ?= install
Expand All @@ -57,6 +57,12 @@ define push_target
DOCKER_BUILDKIT=1 $(OCI_BIN) push ${IMAGE}-$(1);
endef

# manifest create a single arch target provided as argument
define manifest_create_target
echo 'manifest create for arch $(1)'; \
DOCKER_BUILDKIT=1 $(OCI_BIN) manifest add ${IMAGE} ${IMAGE}-$(target);
endef

##@ General

# The help target prints out all targets with their descriptions organized
Expand Down Expand Up @@ -198,8 +204,9 @@ image-push: ## Push MULTIARCH_TARGETS images

.PHONY: manifest-build
manifest-build: ## Build MULTIARCH_TARGETS manifest
@echo 'building manifest $(IMAGE)'
DOCKER_BUILDKIT=1 $(OCI_BIN) manifest create ${IMAGE} $(foreach target,$(MULTIARCH_TARGETS),--amend ${IMAGE}-$(target));
trap 'exit' INT; \
DOCKER_BUILDKIT=1 $(OCI_BIN) manifest create ${IMAGE}
$(foreach target,$(MULTIARCH_TARGETS),$(call manifest_create_target,$(target)))

.PHONY: manifest-push
manifest-push: ## Push MULTIARCH_TARGETS manifest
Expand Down

0 comments on commit e918482

Please sign in to comment.