Skip to content

Commit

Permalink
fix #755: update artifact downloading
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaferraro authored and lburgazzoli committed Jun 26, 2019
1 parent 423835a commit 357bfce
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 10 deletions.
8 changes: 6 additions & 2 deletions script/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)"

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
29 changes: 22 additions & 7 deletions script/package_maven_artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
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

2 changes: 1 addition & 1 deletion script/travis_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 357bfce

Please sign in to comment.