Skip to content
Open
Show file tree
Hide file tree
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
15 changes: 15 additions & 0 deletions backup/pvc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -186,3 +186,18 @@ endif
@echo "Dependencies:"
dep status
@echo

# Multi-arch (buildx) support mirroring root Makefile
PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le

.PHONY: docker-buildx
docker-buildx: check-env ## Build and push multi-arch image (set IMG=quay.io/...:tag)
@echo "+ $@"
sed -e '1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' Dockerfile > Dockerfile.cross
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is no need of doing this, take a look on how we do the whole flow in the root project makefile:

.PHONY: container-runtime-build-%
container-runtime-build-%: ## Build the container
@echo "+ $@"
$(CONTAINER_RUNTIME_COMMAND) buildx build \
--output=type=docker --platform linux/$* \
--build-arg GO_VERSION=$(GO_VERSION) \
--build-arg CTIMEVAR="$(CTIMEVAR)" \
--tag quay.io/$(QUAY_ORGANIZATION)/$(QUAY_REGISTRY):$(GITCOMMIT)-$* . \
--file Dockerfile $(CONTAINER_RUNTIME_EXTRA_ARGS)
.PHONY: container-runtime-build
container-runtime-build: check-env deepcopy-gen container-runtime-build-amd64 container-runtime-build-arm64
.PHONY: container-runtime-images
container-runtime-images: ## List all local containers
@echo "+ $@"
$(CONTAINER_RUNTIME_COMMAND) images $(CONTAINER_RUNTIME_EXTRA_ARGS)
define buildx-create-command
$(CONTAINER_RUNTIME_COMMAND) buildx create \
--driver=docker-container \
--use
endef
## Parameter is version
define container-runtime-push-command
$(CONTAINER_RUNTIME_COMMAND) buildx build \
--output=type=registry --platform linux/amd64,linux/arm64 \
--build-arg GO_VERSION=$(GO_VERSION) \
--build-arg CTIMEVAR="$(CTIMEVAR)" \
--tag quay.io/$(QUAY_ORGANIZATION)/$(QUAY_REGISTRY):$(1) . \
--file Dockerfile $(CONTAINER_RUNTIME_EXTRA_ARGS)
endef
.PHONY: container-runtime-push
container-runtime-push: check-env deepcopy-gen ## Push the container
@echo "+ $@"
$(call buildx-create-command)
$(call container-runtime-push-command,$(BUILD_TAG))
.PHONY: container-runtime-snapshot-push
container-runtime-snapshot-push: check-env deepcopy-gen
@echo "+ $@"
$(call buildx-create-command)
$(call container-runtime-push-command,$(GITCOMMIT))
.PHONY: container-runtime-release-version
container-runtime-release-version: check-env deepcopy-gen ## Release image with version tag (in addition to build tag)
@echo "+ $@"
$(call buildx-create-command)
$(call container-runtime-push-command,$(VERSION_TAG))
.PHONY: container-runtime-release-latest
container-runtime-release-latest: check-env deepcopy-gen ## Release image with latest tags (in addition to build tag)
@echo "+ $@"
$(call buildx-create-command)
$(call container-runtime-push-command,$(LATEST_TAG))
.PHONY: container-runtime-release
container-runtime-release: container-runtime-release-version container-runtime-release-latest ## Release image with version and latest tags (in addition to build tag)
@echo "+ $@"

also in this file we already have a docker-* commands, let's resume those, ty!

- docker buildx create --name backup-pvc-builder
docker buildx use backup-pvc-builder
- docker buildx build --push --platform=$(PLATFORMS) \
--build-arg UID=$(UID) --build-arg GID=$(GID) \
--tag ${IMG} -f Dockerfile.cross .
- docker buildx rm backup-pvc-builder
rm Dockerfile.cross
2 changes: 1 addition & 1 deletion backup/pvc/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.4.3
v0.4.4
2 changes: 1 addition & 1 deletion chart/jenkins-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Kubernetes native operator which fully manages Jenkins on Kubernetes
| jenkins.backup.env[2].name | string | `"BACKUP_COUNT"` | |
| jenkins.backup.env[2].value | string | `"3"` | |
| jenkins.backup.getLatestAction[0] | string | `"/home/user/bin/get-latest.sh"` | |
| jenkins.backup.image | string | `"quay.io/jenkins-kubernetes-operator/backup-pvc:v0.4.3"` | |
| jenkins.backup.image | string | `"quay.io/jenkins-kubernetes-operator/backup-pvc:v0.4.4"` | |
| jenkins.backup.interval | int | `30` | |
| jenkins.backup.makeBackupBeforePodDeletion | bool | `true` | |
| jenkins.backup.pvc.className | string | `""` | |
Expand Down
2 changes: 1 addition & 1 deletion chart/jenkins-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ jenkins:

# image used by backup feature
# By default using prebuilt backup PVC image
image: quay.io/jenkins-kubernetes-operator/backup-pvc:v0.4.3
image: quay.io/jenkins-kubernetes-operator/backup-pvc:v0.4.4

# containerName is backup container name
containerName: backup
Expand Down