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

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

    chore: use latest kamelets
    
    Close #3919
---
 docs/antora.yml           |  4 ++--
 script/Makefile           | 15 +++++++--------
 script/bundle_kamelets.sh | 12 ++++++------
 script/update_docs.sh     | 18 ++++++++++++------
 4 files changed, 27 insertions(+), 22 deletions(-)

diff --git a/docs/antora.yml b/docs/antora.yml
index 3226627ec..ec99bb6e8 100644
--- a/docs/antora.yml
+++ b/docs/antora.yml
@@ -30,8 +30,8 @@ asciidoc:
   attributes:
     requires: "'util=camel-website-util,ck=xref:js/ck.js'"
     prerelease: true
-    camel-kamelets-version: 0.10.0
-    camel-kamelets-docs-version: 0.10.x
+    camel-kamelets-version: 'latest'
+    camel-kamelets-docs-version: next
     camel-k-runtime-version: 1.17.0-SNAPSHOT
     camel-api-versions: camel.apache.org/v1 camel.apache.org/v1alpha1 # from 
Makefile BUNDLE_CAMEL_APIS
     camel-version: 3.19.0
diff --git a/script/Makefile b/script/Makefile
index 17f52f821..432293903 100644
--- a/script/Makefile
+++ b/script/Makefile
@@ -26,7 +26,6 @@ LAST_RELEASED_VERSION ?= 1.11.0
 RUNTIME_VERSION := 1.17.0-SNAPSHOT
 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.16.0
@@ -80,13 +79,12 @@ OPM := opm
 
 # Used to push pre-release artifacts
 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.10.0
+KAMELET_CATALOG_REPO_TAG := main
 
 # When performing integration tests, it is not necessary to always execute 
build, especially
 # in e2e tests when lots of tests are being executed sequentially & the build 
has already taken place.
@@ -148,6 +146,7 @@ bump-replace:
        @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
        ./script/bump_actions.sh $(LAST_RELEASED_VERSION)
@@ -335,12 +334,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