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 2023/03/09 15:37:40 UTC

[camel-k] branch release-1.10.x updated (2d19570de -> ab6c9f85e)

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

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


    from 2d19570de chore: nightly resource refresh
     new 8ed0f3fd7 fix(ci): make codegen
     new f5d035583 fix(ci): use m2 zip
     new cc39f5833 fix: maven overlay script
     new a0d6e2789 fix(test): code refactoring
     new 63339f034 chore: tweak tests
     new ab6c9f85e fix(e2e): provide snapshot repository

The 6 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 e2e/local/util.go                        |   4 ++
 e2e/namespace/install/cli/delete_test.go |   8 ---
 e2e/namespace/install/cli/run_test.go    |  17 +++---
 pkg/util/defaults/defaults.go            |   4 +-
 script/Makefile                          |   4 ++
 script/maven_overlay.sh                  |  72 +++++-----------------
 script/package_maven_artifacts.sh        | 102 +++++++++----------------------
 7 files changed, 64 insertions(+), 147 deletions(-)


[camel-k] 03/06: fix: maven overlay script

Posted by pc...@apache.org.
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 cc39f583326ba1f8ec7cd964de65c2f70ceefa5f
Author: Pasquale Congiusti <pa...@gmail.com>
AuthorDate: Wed Mar 8 17:53:01 2023 +0100

    fix: maven overlay script
---
 script/maven_overlay.sh | 72 +++++++++++--------------------------------------
 1 file changed, 16 insertions(+), 56 deletions(-)

diff --git a/script/maven_overlay.sh b/script/maven_overlay.sh
index c8b25f571..65fa15e6b 100755
--- a/script/maven_overlay.sh
+++ b/script/maven_overlay.sh
@@ -45,49 +45,13 @@ fi
 runtime_version=$1
 output_dir=$2
 
-if [ -n "$staging_repo" ]; then
-    if  [[ $staging_repo == http:* ]] || [[ $staging_repo == https:* ]]; then
-        options="${options} -s ${rootdir}/settings.xml"
-        cat << EOF > ${rootdir}/settings.xml
-<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
-  <profiles>
-    <profile>
-      <id>camel-k-staging</id>
-      <repositories>
-        <repository>
-          <id>camel-k-staging-releases</id>
-          <name>Camel K Staging</name>
-          <url>${staging_repo}</url>
-          <releases>
-            <enabled>true</enabled>
-            <updatePolicy>never</updatePolicy>
-          </releases>
-          <snapshots>
-            <enabled>false</enabled>
-          </snapshots>
-        </repository>
-      </repositories>
-    </profile>
-  </profiles>
-  <activeProfiles>
-    <activeProfile>camel-k-staging</activeProfile>
-  </activeProfiles>
-</settings>
-EOF
-    fi
+if [ ! -z $staging_repo ]; then
+  # Change the settings to include the staging repo if it's not already there
+  echo "INFO: updating the settings staging repository"
+  sed -i "s;<url>https://repository\.apache\.org/content/repositories/orgapachecamel-.*</url>;<url>$staging_repo</url>;" $location/maven-settings.xml
 fi
 
-
-if [ -z "$local_runtime_dir" ]; then
-    mvn -q \
-      $options \
-      dependency:copy \
-      -Dartifact=org.apache.camel.k:camel-k-maven-logging:${runtime_version}:zip \
-      -DoutputDirectory=${rootdir}/${output_dir}
-
-    mv ${rootdir}/${output_dir}/camel-k-maven-logging-${runtime_version}.zip ${rootdir}/${output_dir}/camel-k-maven-logging.zip
-else
+if [ ! -z "$local_runtime_dir" ]; then
     # Take the dependencies from a local development environment
     camel_k_runtime_source_version=$(mvn -f $local_runtime_dir/pom.xml help:evaluate -Dexpression=project.version -q -DforceStdout)
 
@@ -100,20 +64,16 @@ else
       -am \
       -f $local_runtime_dir/support/camel-k-maven-logging/pom.xml \
       install
-
-    mvn -q \
-      $options \
-      dependency:copy \
-      -Dartifact=org.apache.camel.k:camel-k-maven-logging:$camel_k_runtime_source_version:zip \
-      -DoutputDirectory=${rootdir}/${output_dir}
-
-    mv ${rootdir}/${output_dir}/camel-k-maven-logging-$camel_k_runtime_source_version.zip ${rootdir}/${output_dir}/camel-k-maven-logging.zip
-fi
-
-unzip -q -o ${rootdir}/${output_dir}/camel-k-maven-logging.zip -d ${rootdir}/${output_dir}
-
-if [ -n "$staging_repo" ]; then
-    rm ${rootdir}/settings.xml
 fi
 
-rm ${rootdir}/${output_dir}/camel-k-maven-logging.zip
+mvn -q \
+  $options \
+  dependency:copy \
+  -Dartifact=org.apache.camel.k:camel-k-maven-logging:${runtime_version}:zip \
+  -D mdep.useBaseVersion=true \
+  -DoutputDirectory=${rootdir}/${output_dir} \
+  -Papache \
+  -s $location/maven-settings.xml
+
+unzip -q -o ${rootdir}/${output_dir}/camel-k-maven-logging-${runtime_version}.zip -d ${rootdir}/${output_dir}
+rm -f camel-k-maven-logging-${runtime_version}.zip


[camel-k] 01/06: fix(ci): make codegen

Posted by pc...@apache.org.
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 8ed0f3fd7e4bf40058e67f0e39bf5bb81cd5cb1f
Author: Pasquale Congiusti <pa...@gmail.com>
AuthorDate: Wed Mar 8 15:06:47 2023 +0100

    fix(ci): make codegen
---
 pkg/util/defaults/defaults.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pkg/util/defaults/defaults.go b/pkg/util/defaults/defaults.go
index f205386ed..6335e6d51 100644
--- a/pkg/util/defaults/defaults.go
+++ b/pkg/util/defaults/defaults.go
@@ -26,7 +26,7 @@ const (
 	Version = "1.10.5-SNAPSHOT"
 
 	// DefaultRuntimeVersion --
-	DefaultRuntimeVersion = "1.15.2"
+	DefaultRuntimeVersion = "1.15.3-SNAPSHOT"
 
 	// BuildahVersion --
 	BuildahVersion = "1.23.3"
@@ -47,5 +47,5 @@ const (
 	installDefaultKamelets = true
 )
 
-//GitCommit must be provided during application build
+// GitCommit must be provided during application build
 var GitCommit string


[camel-k] 05/06: chore: tweak tests

Posted by pc...@apache.org.
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 63339f0348ed6da72a819b6142a53e04e532180f
Author: Pasquale Congiusti <pa...@gmail.com>
AuthorDate: Thu Mar 9 11:11:24 2023 +0100

    chore: tweak tests
---
 e2e/namespace/install/cli/run_test.go | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/e2e/namespace/install/cli/run_test.go b/e2e/namespace/install/cli/run_test.go
index e367f6356..589f5d6ed 100644
--- a/e2e/namespace/install/cli/run_test.go
+++ b/e2e/namespace/install/cli/run_test.go
@@ -51,7 +51,7 @@ func TestKamelCLIRun(t *testing.T) {
 				Eventually(IntegrationConditionStatus(ns, "java", v1.IntegrationConditionReady), TestTimeoutShort).
 					Should(Equal(corev1.ConditionTrue))
 				Eventually(IntegrationLogs(ns, "java"), TestTimeoutShort).Should(ContainSubstring("Hello Camel K!"))
-				Eventually(DeleteIntegrations(ns), TestTimeoutLong).Should(Equal(0))
+				Expect(Kamel("delete", "--all", "-n", ns).Execute()).To(Succeed())
 			})
 
 			t.Run("Java (RAW)", func(t *testing.T) {
@@ -62,7 +62,7 @@ func TestKamelCLIRun(t *testing.T) {
 				Eventually(IntegrationConditionStatus(ns, "java", v1.IntegrationConditionReady), TestTimeoutShort).
 					Should(Equal(corev1.ConditionTrue))
 				Eventually(IntegrationLogs(ns, "java"), TestTimeoutShort).Should(ContainSubstring("Hello Camel K!"))
-				Eventually(DeleteIntegrations(ns), TestTimeoutLong).Should(Equal(0))
+				Expect(Kamel("delete", "--all", "-n", ns).Execute()).To(Succeed())
 			})
 
 			t.Run("Java (branch)", func(t *testing.T) {
@@ -72,7 +72,7 @@ func TestKamelCLIRun(t *testing.T) {
 				Eventually(IntegrationConditionStatus(ns, "java", v1.IntegrationConditionReady), TestTimeoutShort).
 					Should(Equal(corev1.ConditionTrue))
 				Eventually(IntegrationLogs(ns, "java"), TestTimeoutShort).Should(ContainSubstring("Hello Camel K!"))
-				Eventually(DeleteIntegrations(ns), TestTimeoutLong).Should(Equal(0))
+				Expect(Kamel("delete", "--all", "-n", ns).Execute()).To(Succeed())
 			})
 
 			t.Run("Gist (ID)", func(t *testing.T) {
@@ -98,9 +98,6 @@ func TestKamelCLIRun(t *testing.T) {
 				Eventually(IntegrationLogs(ns, name), TestTimeoutShort).Should(ContainSubstring("Tick!"))
 				Expect(Kamel("delete", "--all", "-n", ns).Execute()).To(Succeed())
 			})
-
-			// Clean up
-			Expect(Kamel("delete", "--all", "-n", ns).Execute()).To(Succeed())
 		})
 
 		t.Run("Run and update", func(t *testing.T) {


[camel-k] 02/06: fix(ci): use m2 zip

Posted by pc...@apache.org.
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 f5d03558303115fae56ed7e999f46db2793b9472
Author: Pasquale Congiusti <pa...@gmail.com>
AuthorDate: Wed Mar 8 16:53:39 2023 +0100

    fix(ci): use m2 zip
---
 script/Makefile                   |   3 ++
 script/package_maven_artifacts.sh | 102 +++++++++++---------------------------
 2 files changed, 33 insertions(+), 72 deletions(-)

diff --git a/script/Makefile b/script/Makefile
index 827cdb430..77b25a59c 100644
--- a/script/Makefile
+++ b/script/Makefile
@@ -407,6 +407,9 @@ else
 endif
 
 images: build kamel-overlay maven-overlay bundle-kamelets
+ifneq (,$(findstring SNAPSHOT,$(RUNTIME_VERSION)))
+	./script/package_maven_artifacts.sh -s "$(STAGING_RUNTIME_REPO)" -d "$(CAMEL_K_RUNTIME_DIR)" $(RUNTIME_VERSION)
+endif
 	@echo "####### Building Camel K operator container image..."
 	mkdir -p build/_maven_output
 	docker build -t $(CUSTOM_IMAGE):$(CUSTOM_VERSION) -f build/Dockerfile .
diff --git a/script/package_maven_artifacts.sh b/script/package_maven_artifacts.sh
index 3b170bc8c..713411a49 100755
--- a/script/package_maven_artifacts.sh
+++ b/script/package_maven_artifacts.sh
@@ -37,84 +37,42 @@ if [ "$#" -lt 1 ]; then
     exit 1
 fi
 
-options=""
-if [ "$CI" = "true" ]; then
-  options="--batch-mode"
-fi
-
 camel_k_destination="$PWD/build/_maven_output"
 camel_k_runtime_version=$1
 maven_repo=${staging_repo:-https://repo1.maven.org/maven2}
 
-if [ -n "$staging_repo" ]; then
-    if  [[ $staging_repo == http:* ]] || [[ $staging_repo == https:* ]]; then
-        options="${options} -s ${rootdir}/settings.xml"
-        cat << EOF > ${rootdir}/settings.xml
-<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
-  <profiles>
-    <profile>
-      <id>camel-k-staging</id>
-      <repositories>
-        <repository>
-          <id>camel-k-staging-releases</id>
-          <name>Camel K Staging</name>
-          <url>${staging_repo}</url>
-          <releases>
-            <enabled>true</enabled>
-            <updatePolicy>never</updatePolicy>
-          </releases>
-          <snapshots>
-            <enabled>false</enabled>
-          </snapshots>
-        </repository>
-      </repositories>
-    </profile>
-  </profiles>
-  <activeProfiles>
-    <activeProfile>camel-k-staging</activeProfile>
-  </activeProfiles>
-</settings>
-EOF
-    fi
-fi
+# Refresh m2 distro project
+rm -rf ${rootdir}/build/m2
+mkdir -p ${rootdir}/build/m2
+
+# Refresh maven output dir
+rm -rf ${camel_k_destination}
+mkdir -p ${camel_k_destination}
 
 if [ -z "${local_runtime_dir}" ]; then
-    is_snapshot=$(echo "${camel_k_runtime_version}" | grep "SNAPSHOT")
-    if [ "$is_snapshot" = "${camel_k_runtime_version}" ]; then
-        echo "You're trying to package SNAPSHOT artifacts. You probably wants them from your local environment, try calling:"
-        echo "$0 <Camel K runtime version> <local Camel K runtime project directory>"
-        exit 3
-    fi
+  # Remote M2 distro
+  if [ ! -z $staging_repo ]; then
+    # Change the settings to include the staging repo if it's not already there
+    echo "INFO: updating the settings staging repository"
+    sed -i "s;<url>https://repository\.apache\.org/content/repositories/orgapachecamel-.*</url>;<url>$staging_repo</url>;" $location/maven-settings.xml
+  fi
 
-    # Take the dependencies officially released
-    wget ${maven_repo}/org/apache/camel/k/apache-camel-k-runtime/${camel_k_runtime_version}/apache-camel-k-runtime-${camel_k_runtime_version}-source-release.zip -O $PWD/build/apache-camel-k-runtime-${camel_k_runtime_version}-source-release.zip
-    unzip -q -o $PWD/build/apache-camel-k-runtime-${camel_k_runtime_version}-source-release.zip -d $PWD/build
-    mvn -q \
-        $options \
-        -f $PWD/build/apache-camel-k-runtime-${camel_k_runtime_version}/pom.xml \
-        dependency:copy-dependencies \
-        -DincludeScope=runtime \
-        -Dmdep.copyPom=true \
-        -DoutputDirectory=$camel_k_destination \
-        -Dmdep.useRepositoryLayout=true
-    rm -rf $PWD/build/apache-camel-k-runtime*
+  #TODO: remove this check once Camel K 1.16.0 is released
+  if [[ $camel_k_runtime_version != *"SNAPSHOT"* ]]; then
+    echo "WARN: Package Camel K runtime artifacts temporary removed because of https://github.com/apache/camel-k-runtime/pull/928 issue"
+    echo "Please, remove this check when Camel K Runtime 1.16.0 is officially released"
+    exit 0
+  fi
+  echo "Downloading Camel K runtime $camel_k_runtime_version M2 (may take some minute ...)"
+  mvn -q dependency:copy -Dartifact="org.apache.camel.k:apache-camel-k-runtime:$camel_k_runtime_version:zip:m2" \
+    -Dmdep.useBaseVersion=true \
+    -DoutputDirectory=${rootdir}/build/m2 \
+    -s $location/maven-settings.xml \
+    -Papache
+  unzip -q -o $PWD/build/m2/apache-camel-k-runtime-${camel_k_runtime_version}-m2.zip -d $camel_k_destination
 else
-    # Take the dependencies from a local development environment
-    camel_k_runtime_source=${local_runtime_dir}
-    camel_k_runtime_source_version=$(mvn $options -f $camel_k_runtime_source/pom.xml help:evaluate -Dexpression=project.version -q -DforceStdout)
-
-    if [ "$camel_k_runtime_version" != "$camel_k_runtime_source_version" ]; then
-        echo "Misaligned version. You're building Camel K project using $camel_k_runtime_version but trying to bundle dependencies from local Camel K runtime $camel_k_runtime_source_version"
-        exit 2
-    fi
-
-    mvn -q \
-        $options \
-        -f $camel_k_runtime_source/pom.xml \
-    dependency:copy-dependencies \
-        -DincludeScope=runtime \
-        -Dmdep.copyPom=true \
-        -DoutputDirectory=$camel_k_destination \
-        -Dmdep.useRepositoryLayout=true
+  # Local M2 distro
+  echo "Installing local Camel K runtime $camel_k_runtime_version M2 from $local_runtime_dir (may take some minute ...)"
+  mvn -q -f $local_runtime_dir/distribution clean install
+  unzip -q -o $local_runtime_dir/distribution/target/apache-camel-k-runtime-${camel_k_runtime_version}-m2.zip -d $camel_k_destination
 fi


[camel-k] 04/06: fix(test): code refactoring

Posted by pc...@apache.org.
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 a0d6e27895ba5d4d043f95bdfdaab2407242724b
Author: Pasquale Congiusti <pa...@gmail.com>
AuthorDate: Mon Mar 6 14:48:27 2023 +0100

    fix(test): code refactoring
    
    Ref #4086
---
 e2e/namespace/install/cli/delete_test.go |  8 --------
 e2e/namespace/install/cli/run_test.go    | 20 +++++++++++---------
 2 files changed, 11 insertions(+), 17 deletions(-)

diff --git a/e2e/namespace/install/cli/delete_test.go b/e2e/namespace/install/cli/delete_test.go
index e453a304b..a1523df68 100644
--- a/e2e/namespace/install/cli/delete_test.go
+++ b/e2e/namespace/install/cli/delete_test.go
@@ -52,14 +52,6 @@ func TestKamelCLIDelete(t *testing.T) {
 			Eventually(IntegrationPod(ns, "yaml"), TestTimeoutMedium).Should(BeNil())
 		})
 
-		t.Run("delete integration from csv", func(t *testing.T) {
-			Expect(KamelRunWithID(operatorID, ns, "github:apache/camel-k/e2e/namespace/install/cli/files/yaml.yaml").Execute()).To(Succeed())
-			Eventually(IntegrationPodPhase(ns, "yaml"), TestTimeoutLong).Should(Equal(corev1.PodRunning))
-			Expect(Kamel("delete", "yaml", "-n", ns).Execute()).To(Succeed())
-			Eventually(Integration(ns, "yaml")).Should(BeNil())
-			Eventually(IntegrationPod(ns, "yaml"), TestTimeoutMedium).Should(BeNil())
-		})
-
 		t.Run("delete several integrations", func(t *testing.T) {
 			Expect(KamelRunWithID(operatorID, ns, "../files/yaml.yaml").Execute()).To(Succeed())
 			Expect(KamelRunWithID(operatorID, ns, "../files/Java.java").Execute()).To(Succeed())
diff --git a/e2e/namespace/install/cli/run_test.go b/e2e/namespace/install/cli/run_test.go
index 4bca39e8a..e367f6356 100644
--- a/e2e/namespace/install/cli/run_test.go
+++ b/e2e/namespace/install/cli/run_test.go
@@ -36,6 +36,8 @@ import (
 	v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
 )
 
+var sampleJar = "https://raw.githubusercontent.com/apache/camel-k/main/e2e/common/traits/files/jvm/sample-1.0.jar"
+
 func TestKamelCLIRun(t *testing.T) {
 	WithNewTestNamespace(t, func(ns string) {
 		operatorID := fmt.Sprintf("camel-k-%s", ns)
@@ -44,33 +46,33 @@ func TestKamelCLIRun(t *testing.T) {
 		t.Run("Examples from GitHub", func(t *testing.T) {
 			t.Run("Java", func(t *testing.T) {
 				Expect(KamelRunWithID(operatorID, ns,
-					"github:apache/camel-k/e2e/namespace/install/files/Java.java").Execute()).To(Succeed())
+					"github:apache/camel-k-examples/generic-examples/languages/Sample.java", "--name", "java").Execute()).To(Succeed())
 				Eventually(IntegrationPodPhase(ns, "java"), TestTimeoutLong).Should(Equal(corev1.PodRunning))
 				Eventually(IntegrationConditionStatus(ns, "java", v1.IntegrationConditionReady), TestTimeoutShort).
 					Should(Equal(corev1.ConditionTrue))
-				Eventually(IntegrationLogs(ns, "java"), TestTimeoutShort).Should(ContainSubstring("Magicstring!"))
-				Expect(Kamel("delete", "--all", "-n", ns).Execute()).To(Succeed())
+				Eventually(IntegrationLogs(ns, "java"), TestTimeoutShort).Should(ContainSubstring("Hello Camel K!"))
+				Eventually(DeleteIntegrations(ns), TestTimeoutLong).Should(Equal(0))
 			})
 
 			t.Run("Java (RAW)", func(t *testing.T) {
 				Expect(KamelRunWithID(operatorID, ns,
-					"https://raw.githubusercontent.com/apache/camel-k/main/e2e/namespace/install/files/Java.java").Execute()).
+					"https://raw.githubusercontent.com/apache/camel-k-examples/main/generic-examples/languages/Sample.java", "--name", "java").Execute()).
 					To(Succeed())
 				Eventually(IntegrationPodPhase(ns, "java"), TestTimeoutLong).Should(Equal(corev1.PodRunning))
 				Eventually(IntegrationConditionStatus(ns, "java", v1.IntegrationConditionReady), TestTimeoutShort).
 					Should(Equal(corev1.ConditionTrue))
-				Eventually(IntegrationLogs(ns, "java"), TestTimeoutShort).Should(ContainSubstring("Magicstring!"))
-				Expect(Kamel("delete", "--all", "-n", ns).Execute()).To(Succeed())
+				Eventually(IntegrationLogs(ns, "java"), TestTimeoutShort).Should(ContainSubstring("Hello Camel K!"))
+				Eventually(DeleteIntegrations(ns), TestTimeoutLong).Should(Equal(0))
 			})
 
 			t.Run("Java (branch)", func(t *testing.T) {
 				Expect(KamelRunWithID(operatorID, ns,
-					"github:apache/camel-k/e2e/namespace/install/files/Java.java?branch=main").Execute()).To(Succeed())
+					"github:apache/camel-k-examples/generic-examples/languages/Sample.java?branch=main", "--name", "java").Execute()).To(Succeed())
 				Eventually(IntegrationPodPhase(ns, "java"), TestTimeoutLong).Should(Equal(corev1.PodRunning))
 				Eventually(IntegrationConditionStatus(ns, "java", v1.IntegrationConditionReady), TestTimeoutShort).
 					Should(Equal(corev1.ConditionTrue))
-				Eventually(IntegrationLogs(ns, "java"), TestTimeoutShort).Should(ContainSubstring("Magicstring!"))
-				Expect(Kamel("delete", "--all", "-n", ns).Execute()).To(Succeed())
+				Eventually(IntegrationLogs(ns, "java"), TestTimeoutShort).Should(ContainSubstring("Hello Camel K!"))
+				Eventually(DeleteIntegrations(ns), TestTimeoutLong).Should(Equal(0))
 			})
 
 			t.Run("Gist (ID)", func(t *testing.T) {


[camel-k] 06/06: fix(e2e): provide snapshot repository

Posted by pc...@apache.org.
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 ab6c9f85e340c8648c9fad949c339efbdda0fffa
Author: Pasquale Congiusti <pa...@gmail.com>
AuthorDate: Wed Oct 26 11:22:48 2022 +0200

    fix(e2e): provide snapshot repository
---
 e2e/local/util.go | 4 ++++
 script/Makefile   | 1 +
 2 files changed, 5 insertions(+)

diff --git a/e2e/local/util.go b/e2e/local/util.go
index aa2ffd2fe..4d6e5ca4e 100644
--- a/e2e/local/util.go
+++ b/e2e/local/util.go
@@ -31,6 +31,7 @@ import (
 )
 
 var runtimeRepo = os.Getenv("STAGING_RUNTIME_REPO")
+var runtimeVersion = os.Getenv("RUNTIME_VERSION")
 
 func Docker(args ...string) string {
 	cmd := exec.CommandContext(TestContext, "docker", args...)
@@ -58,5 +59,8 @@ func kamelWithContext(ctx context.Context, args ...string) *cobra.Command {
 	if runtimeRepo != "" {
 		args = append(args, "--maven-repository", runtimeRepo)
 	}
+	if strings.HasSuffix(runtimeVersion, "-SNAPSHOT") {
+		args = append(args, "--maven-repository", "https://repository.apache.org/content/repositories/snapshots-group@snapshots")
+	}
 	return KamelWithContext(ctx, args...)
 }
diff --git a/script/Makefile b/script/Makefile
index 77b25a59c..348b8bb99 100644
--- a/script/Makefile
+++ b/script/Makefile
@@ -279,6 +279,7 @@ test-service-binding: do-build
 
 test-local: do-build
 	STAGING_RUNTIME_REPO="$(STAGING_RUNTIME_REPO)" \
+	RUNTIME_VERSION="$(RUNTIME_VERSION)" \
 	go test -timeout 30m -v ./e2e/local -tags=integration $(TEST_LOCAL_RUN) -json 2>&1 | gotestfmt
 
 test-registry-maven-wagon: do-build