This is an automated email from the ASF dual-hosted git repository.

pcongiusti pushed a commit to branch release-1.10.x
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 29defedaca7d229bde6127f0980c02d112ab92c4
Author: Pasquale Congiusti <pasquale.congiu...@gmail.com>
AuthorDate: Wed Dec 21 14:27:17 2022 +0100

    chore: use latest kamelets
    
    Close #3919
---
 script/Makefile           | 12 +++++++-----
 script/bundle_kamelets.sh | 12 ++++++------
 script/update_docs.sh     | 18 ++++++++++++------
 3 files changed, 25 insertions(+), 17 deletions(-)

diff --git a/script/Makefile b/script/Makefile
index 4e5ff931b..764bdaf94 100644
--- a/script/Makefile
+++ b/script/Makefile
@@ -20,7 +20,6 @@ LAST_RELEASED_VERSION ?= 1.10.3
 RUNTIME_VERSION := 1.15.2
 BUILDAH_VERSION := 1.23.3
 KANIKO_VERSION := 0.17.1
-INSTALL_DEFAULT_KAMELETS := true
 CONTROLLER_GEN_VERSION := v0.6.1
 CODEGEN_VERSION := v0.23.5
 OPERATOR_SDK_VERSION := v1.14.0
@@ -77,7 +76,8 @@ STAGING_IMAGE_NAME := docker.io/camelk/camel-k
 
 STAGING_RUNTIME_REPO :=
 
-# Define here the repo containing the default Kamelet catalog (if any)
+# Kamelets options
+INSTALL_DEFAULT_KAMELETS ?= true
 KAMELET_CATALOG_REPO := https://github.com/apache/camel-kamelets.git
 # Optional branch for the default Kamelet catalog (change this to a tag before 
release)
 KAMELET_CATALOG_REPO_BRANCH := v0.9.3
@@ -141,6 +141,8 @@ bump-replace:
        @# Bump version and replace with the variables provided by the user
        @sed -i 's/^VERSION ?= .*$//VERSION ?= $(VERSION)/' ./script/Makefile
        @sed -i 's/^LAST_RELEASED_VERSION ?= .*$//LAST_RELEASED_VERSION ?= 
$(LAST_RELEASED_VERSION)/' ./script/Makefile
+       @sed -i 's/^STAGING_RUNTIME_REPO :=.*$//STAGING_RUNTIME_REPO :=/' 
./script/Makefile
+       @sed -i 's/^KAMELET_CATALOG_REPO_TAG :=.*$//KAMELET_CATALOG_REPO_TAG := 
main/' ./script/Makefile
 
 bump: bump-replace codegen bundle
 
@@ -321,12 +323,12 @@ build-resources:
 bundle-kamelets:
        @echo "Preparing Kamelets bundle resource..."
 ifneq (,$(findstring release,$(MAKECMDGOALS)))
-ifneq (,$(findstring $(KAMELET_CATALOG_REPO_BRANCH), main))
-       @echo "You cannot set 
KAMELET_CATALOG_REPO_BRANCH=$(KAMELET_CATALOG_REPO_BRANCH) when doing a release"
+ifneq (,$(findstring $(KAMELET_CATALOG_REPO_TAG), main))
+       @echo "You cannot set 
KAMELET_CATALOG_REPO_TAG=$(KAMELET_CATALOG_REPO_TAG) when doing a release"
        @exit 1
 endif
 endif
-       ./script/bundle_kamelets.sh $(KAMELET_CATALOG_REPO) 
$(KAMELET_CATALOG_REPO_BRANCH)
+       ./script/bundle_kamelets.sh $(KAMELET_CATALOG_REPO) 
$(KAMELET_CATALOG_REPO_TAG)
 
 build-submodules:
        ./script/build_submodules.sh
diff --git a/script/bundle_kamelets.sh b/script/bundle_kamelets.sh
index 66e7e1a81..2d94ab91e 100755
--- a/script/bundle_kamelets.sh
+++ b/script/bundle_kamelets.sh
@@ -21,7 +21,7 @@ rootdir=$location/../
 set -e
 
 repo=$1
-branch=$2
+tag=$2
 
 cd $rootdir
 target=./build/_kamelets
@@ -35,15 +35,15 @@ if [ "$repo" = "" ]; then
        exit 0
 fi
 
-if [ "$branch" = "" ]; then
-  branch="main"
+if [ "$tag" = "" ]; then
+       echo "ERROR: no kamelet catalog version defined"
+       exit 1
 fi
 
-echo "Cloning repository $repo on branch $branch to bundle kamelets..."
-
+echo "Cloning repository $repo from tag $tag to bundle kamelets..."
 
 rm -rf ./tmp_kamelet_catalog
-git clone -b $branch --single-branch --depth 1 $repo ./tmp_kamelet_catalog
+git clone -q -c advice.detachedHead=false -b $tag --single-branch --depth 1 
$repo ./tmp_kamelet_catalog
 
 cp ./tmp_kamelet_catalog/kamelets/*.kamelet.yaml $target
 
diff --git a/script/update_docs.sh b/script/update_docs.sh
index 15758f385..67d48d74b 100755
--- a/script/update_docs.sh
+++ b/script/update_docs.sh
@@ -27,13 +27,19 @@ if [ ! -f $CATALOG ]; then
     exit 1
 fi
 
-KAMELETS_VERSION=$(grep '^KAMELET_CATALOG_REPO_BRANCH := ' Makefile | sed 
's/^.* \?= //' | sed 's/^.//')
-re="^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)$"
-if ! [[ $KAMELETS_VERSION =~ $re ]]; then
-    echo "❗ argument must match semantic version: $KAMELETS_VERSION"
-    exit 1
+KAMELET_CATALOG_REPO_TAG=$(grep '^KAMELET_CATALOG_REPO_TAG := ' Makefile | sed 
's/^.* \?= //')
+KAMELETS_VERSION=$(echo $KAMELET_CATALOG_REPO_TAG | sed 's/^.//')
+if [[ "$KAMELET_CATALOG_REPO_TAG" == "main" ]]; then
+    KAMELETS_VERSION="latest"
+    KAMELETS_DOCS_VERSION="next"
+else
+    re="^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)$"
+    if ! [[ $KAMELETS_VERSION =~ $re ]]; then
+        echo "❗ argument must match semantic version: $KAMELETS_VERSION"
+        exit 1
+    fi
+    KAMELETS_DOCS_VERSION="${BASH_REMATCH[1]}.${BASH_REMATCH[2]}.x"
 fi
-KAMELETS_DOCS_VERSION="${BASH_REMATCH[1]}.${BASH_REMATCH[2]}.x"
 BUILDAH_VERSION=$(grep '^BUILDAH_VERSION := ' Makefile | sed 's/^.* \?= //')
 KANIKO_VERSION=$(grep '^KANIKO_VERSION := ' Makefile | sed 's/^.* \?= //')
 KUSTOMIZE_VERSION=$(grep '^KUSTOMIZE_VERSION := ' Makefile | sed 's/^.* \?= 
//' | sed 's/^.//')

Reply via email to