You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by pc...@apache.org on 2024/03/19 10:02:16 UTC
(camel-k) branch main updated: fix(#5252): release-nightly does not build/push multiarch manifest
This is an automated email from the ASF dual-hosted git repository.
pcongiusti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git
The following commit(s) were added to refs/heads/main by this push:
new e7e8377c1 fix(#5252): release-nightly does not build/push multiarch manifest
e7e8377c1 is described below
commit e7e8377c1995a6a266809421bd728f0ce7b5f006
Author: Thomas Diesler <td...@redhat.com>
AuthorDate: Fri Mar 15 13:40:27 2024 +0100
fix(#5252): release-nightly does not build/push multiarch manifest
---
.github/actions/release-nightly/action.yml | 1 -
.../ROOT/pages/contributing/developers.adoc | 4 +--
script/Makefile | 32 +++++++++++++++-------
3 files changed, 24 insertions(+), 13 deletions(-)
diff --git a/.github/actions/release-nightly/action.yml b/.github/actions/release-nightly/action.yml
index 49defbd81..c43ed8959 100644
--- a/.github/actions/release-nightly/action.yml
+++ b/.github/actions/release-nightly/action.yml
@@ -110,7 +110,6 @@ runs:
shell: bash
run: |
make VERSION=${{ env.VERSION }} IMAGE_NAME=${{ env.IMAGE_NAME }} images-nightly
- make IMAGE_ARCH=arm64 VERSION=${{ env.VERSION }} IMAGE_NAME=${{ env.IMAGE_NAME }} images-nightly
make VERSION=${{ env.VERSION }} IMAGE_NAME=${{ env.IMAGE_NAME }} release-nightly
- name: Generate SBOM
diff --git a/docs/modules/ROOT/pages/contributing/developers.adoc b/docs/modules/ROOT/pages/contributing/developers.adoc
index 8d662ba3b..6f699cc82 100644
--- a/docs/modules/ROOT/pages/contributing/developers.adoc
+++ b/docs/modules/ROOT/pages/contributing/developers.adoc
@@ -96,11 +96,11 @@ After a successful build, if you're connected to a Docker daemon, you can build
make images
----
-The above command produces a `camel-k` image with the name `docker.io/apache/camel-k`. Sometimes you might need to produce `camel-k` images that need to be pushed to the custom repository e.g. `docker.io/myrepo/camel-k`, to do that you can pass a parameter `STAGING_IMAGE_NAME` to `make` as shown below:
+The above command produces a `camel-k` image with the name `docker.io/apache/camel-k`. Sometimes you might need to produce `camel-k` images that need to be pushed to the custom repository e.g. `docker.io/myrepo/camel-k`, to do that you can pass a parameter `STAGING_IMAGE` to `make` as shown below:
[source]
----
-make STAGING_IMAGE_NAME='docker.io/myrepo/camel-k' images-push-staging
+make STAGING_IMAGE='docker.io/myrepo/camel-k' images-push-staging
----
[[testing]]
diff --git a/script/Makefile b/script/Makefile
index 32e515ac9..a63e165cf 100644
--- a/script/Makefile
+++ b/script/Makefile
@@ -78,7 +78,7 @@ INDEX_DIR := index
OPM := opm
# Used to push pre-release artifacts
-STAGING_IMAGE_NAME := docker.io/camelk/camel-k
+STAGING_IMAGE := docker.io/camelk/camel-k
STAGING_RUNTIME_REPO :=
# Kamelets options
@@ -456,17 +456,29 @@ images-all:
make IMAGE_ARCH=arm64 images
make IMAGE_ARCH=amd64 images
+images-push:
+ docker push $(CUSTOM_IMAGE):$(CUSTOM_VERSION)-amd64
+ docker push $(CUSTOM_IMAGE):$(CUSTOM_VERSION)
+ @if docker inspect $(CUSTOM_IMAGE):$(CUSTOM_VERSION)-arm64 &> /dev/null; then \
+ echo "Image $(CUSTOM_IMAGE):$(CUSTOM_VERSION)-arm64 exists, building the multiarch manifest"; \
+ docker push $(CUSTOM_IMAGE):$(CUSTOM_VERSION)-arm64; \
+ docker manifest create $(CUSTOM_IMAGE):$(CUSTOM_VERSION) --amend $(CUSTOM_IMAGE):$(CUSTOM_VERSION)-amd64 --amend $(CUSTOM_IMAGE):$(CUSTOM_VERSION)-arm64; \
+ docker manifest push --purge $(CUSTOM_IMAGE):$(CUSTOM_VERSION); \
+ else \
+ echo "Image $(CUSTOM_IMAGE):$(CUSTOM_VERSION)-arm64 does not exist"; \
+ fi
+
images-push-staging:
- docker tag $(CUSTOM_IMAGE):$(CUSTOM_VERSION)-amd64 $(STAGING_IMAGE_NAME):$(CUSTOM_VERSION)-amd64
- docker tag $(CUSTOM_IMAGE):$(CUSTOM_VERSION)-amd64 $(STAGING_IMAGE_NAME):$(CUSTOM_VERSION)
- docker push $(STAGING_IMAGE_NAME):$(CUSTOM_VERSION)-amd64
- docker push $(STAGING_IMAGE_NAME):$(CUSTOM_VERSION)
+ docker tag $(CUSTOM_IMAGE):$(CUSTOM_VERSION)-amd64 $(STAGING_IMAGE):$(CUSTOM_VERSION)-amd64
+ docker tag $(CUSTOM_IMAGE):$(CUSTOM_VERSION)-amd64 $(STAGING_IMAGE):$(CUSTOM_VERSION)
+ docker push $(STAGING_IMAGE):$(CUSTOM_VERSION)-amd64
+ docker push $(STAGING_IMAGE):$(CUSTOM_VERSION)
@if docker inspect $(CUSTOM_IMAGE):$(CUSTOM_VERSION)-arm64 &> /dev/null; then \
echo "Image $(CUSTOM_IMAGE):$(CUSTOM_VERSION)-arm64 exists, building the multiarch manifest"; \
- docker tag $(CUSTOM_IMAGE):$(CUSTOM_VERSION)-arm64 $(STAGING_IMAGE_NAME):$(CUSTOM_VERSION)-arm64; \
- docker push $(STAGING_IMAGE_NAME):$(CUSTOM_VERSION)-arm64; \
- docker manifest create $(STAGING_IMAGE_NAME):$(CUSTOM_VERSION) --amend $(STAGING_IMAGE_NAME):$(CUSTOM_VERSION)-amd64 --amend $(STAGING_IMAGE_NAME):$(CUSTOM_VERSION)-arm64; \
- docker manifest push --purge $(STAGING_IMAGE_NAME):$(CUSTOM_VERSION); \
+ docker tag $(CUSTOM_IMAGE):$(CUSTOM_VERSION)-arm64 $(STAGING_IMAGE):$(CUSTOM_VERSION)-arm64; \
+ docker push $(STAGING_IMAGE):$(CUSTOM_VERSION)-arm64; \
+ docker manifest create $(STAGING_IMAGE):$(CUSTOM_VERSION) --amend $(STAGING_IMAGE):$(CUSTOM_VERSION)-amd64 --amend $(STAGING_IMAGE):$(CUSTOM_VERSION)-arm64; \
+ docker manifest push --purge $(STAGING_IMAGE):$(CUSTOM_VERSION); \
else \
echo "Image $(CUSTOM_IMAGE):$(CUSTOM_VERSION)-arm64 does not exist"; \
fi
@@ -508,7 +520,7 @@ sbomgen:
cyclonedx-gomod mod -licenses -json -output sbom.json
# Build images
-images-nightly: clean codegen set-version build-resources images
+images-nightly: clean codegen set-version build-resources images-all
# Release artifacts
release-nightly: cross-compile images-push