diff --git a/script/Makefile b/script/Makefile index 20bcd8b538..143a3b8717 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 c2feb3081b..0789ce39ee 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 e9574bb1bd..619a975391 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