Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: fix ghcr push #3698

Merged
merged 2 commits into from
Nov 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
REPOSITORY ?= openpolicyagent/gatekeeper
CRD_REPOSITORY ?= openpolicyagent/gatekeeper-crds
GATOR_REPOSITORY ?= openpolicyagent/gator

GHCR_REPOSITORY ?= ghcr.io/open-policy-agent/gatekeeper
GHCR_CRD_REPOSITORY ?= ghcr.io/open-policy-agent/gatekeeper-crds
GHCR_GATOR_REPOSITORY ?= ghcr.io/open-policy-agent/gator

IMG := $(REPOSITORY):latest
CRD_IMG := $(CRD_REPOSITORY):latest
GATOR_IMG := $(GATOR_REPOSITORY):latest
Expand Down Expand Up @@ -418,8 +423,8 @@ docker-buildx-dev: docker-buildx-builder
--output=$(OUTPUT_TYPE) \
-t $(REPOSITORY):$(DEV_TAG) \
-t $(REPOSITORY):dev \
$(if $(filter true,$(PUSH_TO_GHCR)),-t ghcr.io/$(REPOSITORY):$(DEV_TAG)) \
$(if $(filter true,$(PUSH_TO_GHCR)),-t ghcr.io/$(REPOSITORY):dev) .
$(if $(filter true,$(PUSH_TO_GHCR)),-t $(GHCR_REPOSITORY):$(DEV_TAG)) \
$(if $(filter true,$(PUSH_TO_GHCR)),-t $(GHCR_REPOSITORY):dev) .

docker-buildx-crds-dev: build-crds docker-buildx-builder
docker buildx build \
Expand All @@ -429,8 +434,8 @@ docker-buildx-crds-dev: build-crds docker-buildx-builder
--output=$(OUTPUT_TYPE) \
-t $(CRD_REPOSITORY):$(DEV_TAG) \
-t $(CRD_REPOSITORY):dev \
$(if $(filter true,$(PUSH_TO_GHCR)),-t ghcr.io/$(CRD_REPOSITORY):$(DEV_TAG)) \
$(if $(filter true,$(PUSH_TO_GHCR)),-t ghcr.io/$(CRD_REPOSITORY):dev) \
$(if $(filter true,$(PUSH_TO_GHCR)),-t $(GHCR_CRD_REPOSITORY):$(DEV_TAG)) \
$(if $(filter true,$(PUSH_TO_GHCR)),-t $(GHCR_CRD_REPOSITORY):dev) \
-f crd.Dockerfile .staging/crds/

docker-buildx-release: docker-buildx-builder
Expand All @@ -440,7 +445,7 @@ docker-buildx-release: docker-buildx-builder
--platform="$(PLATFORM)" \
--output=$(OUTPUT_TYPE) \
-t $(REPOSITORY):$(VERSION) \
$(if $(filter true,$(PUSH_TO_GHCR)),-t ghcr.io/$(REPOSITORY):$(VERSION)) .
$(if $(filter true,$(PUSH_TO_GHCR)),-t $(GHCR_REPOSITORY):$(VERSION)) .

docker-buildx-crds-release: build-crds docker-buildx-builder
docker buildx build \
Expand All @@ -449,7 +454,7 @@ docker-buildx-crds-release: build-crds docker-buildx-builder
--platform="$(PLATFORM)" \
--output=$(OUTPUT_TYPE) \
-t $(CRD_REPOSITORY):$(VERSION) \
$(if $(filter true,$(PUSH_TO_GHCR)),-t ghcr.io/$(CRD_REPOSITORY):$(VERSION)) \
$(if $(filter true,$(PUSH_TO_GHCR)),-t $(GHCR_CRD_REPOSITORY):$(VERSION)) \
-f crd.Dockerfile .staging/crds/

# Build gator image
Expand All @@ -461,8 +466,8 @@ docker-buildx-gator-dev: docker-buildx-builder
--output=$(OUTPUT_TYPE) \
-t ${GATOR_REPOSITORY}:${DEV_TAG} \
-t ${GATOR_REPOSITORY}:dev \
$(if $(filter true,$(PUSH_TO_GHCR)),-t ghcr.io/${GATOR_REPOSITORY}:${DEV_TAG}) \
$(if $(filter true,$(PUSH_TO_GHCR)),-t ghcr.io/${GATOR_REPOSITORY}:dev) \
$(if $(filter true,$(PUSH_TO_GHCR)),-t ${GHCR_REPOSITORY}:${DEV_TAG}) \
$(if $(filter true,$(PUSH_TO_GHCR)),-t ${GHCR_REPOSITORY}:dev) \
-f gator.Dockerfile .

docker-buildx-gator-release: docker-buildx-builder
Expand All @@ -472,7 +477,7 @@ docker-buildx-gator-release: docker-buildx-builder
--platform="$(PLATFORM)" \
--output=$(OUTPUT_TYPE) \
-t ${GATOR_REPOSITORY}:${VERSION} \
$(if $(filter true,$(PUSH_TO_GHCR)),-t ghcr.io/${GATOR_REPOSITORY}:${VERSION}) \
$(if $(filter true,$(PUSH_TO_GHCR)),-t ${GHCR_REPOSITORY}:${VERSION}) \
-f gator.Dockerfile .

# Update manager_image_patch.yaml with image tag
Expand Down
Loading