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

lburgazzoli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 357bfce032017b55667d88e227773def2336cd76
Author: nferraro <ni.ferr...@gmail.com>
AuthorDate: Thu Jun 20 11:34:33 2019 +0200

    fix #755: update artifact downloading
---
 script/Makefile                   |  8 ++++++--
 script/package_maven_artifacts.sh | 29 ++++++++++++++++++++++-------
 script/travis_build.sh            |  2 +-
 3 files changed, 29 insertions(+), 10 deletions(-)

diff --git a/script/Makefile b/script/Makefile
index 20bcd8b..143a3b8 100644
--- a/script/Makefile
+++ b/script/Makefile
@@ -30,6 +30,10 @@ GPG_PASS := $(GPG_PASS)
 # Used to push pre-relase artifacts
 STAGING_IMAGE_NAME := docker.io/camelk/camel-k
 
+# When packaging artifacts into the docker image, you can "copy" them from 
local maven
+# or "download" them from Apache Snapshots and Maven Central
+PACKAGE_ARTIFACTS_STRATEGY := copy
+
 GOLDFLAGS += -X main.GitCommit=$(GIT_COMMIT)
 GOFLAGS = -ldflags "$(GOLDFLAGS)"
 
@@ -118,7 +122,7 @@ build-olm:
        ./script/build_olm.sh $(VERSION)
 
 build-compile-integration-tests:
-       go test -c -tags=integration ./test/*.go
+       go test -c -tags=integration ./e2e/*.go
 
 clean:
        # go clean fails if modules support are turned on as it tries to 
@@ -184,7 +188,7 @@ package-examples:
        ./script/package_examples.sh $(VERSION)
 
 package-artifacts:
-       ./script/package_maven_artifacts.sh $(RUNTIME_VERSION)
+       ./script/package_maven_artifacts.sh $(RUNTIME_VERSION) 
$(PACKAGE_ARTIFACTS_STRATEGY)
 
 unsnapshot-olm:
        ./script/unsnapshot_olm.sh
diff --git a/script/package_maven_artifacts.sh 
b/script/package_maven_artifacts.sh
index c2feb30..0789ce3 100755
--- a/script/package_maven_artifacts.sh
+++ b/script/package_maven_artifacts.sh
@@ -17,15 +17,30 @@
 
 location=$(dirname $0)
 
-if [ "$#" -ne 1 ]; then
-    echo "usage: $0 version"
+if [ "$#" -ne 2 ]; then
+    echo "usage: $0 version strategy"
     exit 1
 fi
 
+version=$1
+strategy=$2
+
 cd ${location}/..
 
-./mvnw \
-    -f build/maven/pom-runtime.xml \
-    -DoutputDirectory=$PWD/build/_maven_output \
-    -Druntime.version=$1 \
-    dependency:copy-dependencies
\ No newline at end of file
+if [ "$strategy" = "copy" ]; then
+    ./mvnw \
+        -f build/maven/pom-runtime.xml \
+        -DoutputDirectory=$PWD/build/_maven_output \
+        -Druntime.version=$1 \
+        dependency:copy-dependencies
+elif [ "$strategy" = "download" ]; then
+    ./mvnw \
+        -f build/maven/pom-runtime.xml \
+        -Dmaven.repo.local=$PWD/build/_maven_output \
+        -Druntime.version=$1 \
+        install
+else
+    echo "unknown strategy: $strategy"
+    exit 1
+fi
+
diff --git a/script/travis_build.sh b/script/travis_build.sh
index e9574bb..619a975 100755
--- a/script/travis_build.sh
+++ b/script/travis_build.sh
@@ -66,7 +66,7 @@ echo "openshift is deployed and reachable"
 oc describe nodes
 
 echo "Adding maven artifacts to the image context"
-make package-artifacts
+make PACKAGE_ARTIFACTS_STRATEGY=download package-artifacts
 
 echo "Copying binary file to docker dir"
 mkdir -p ./build/_output/bin

Reply via email to