From 493cd78e7754cacb6ed0e3b3f667402655321d6b Mon Sep 17 00:00:00 2001 From: Bruno Thomas Date: Wed, 26 Feb 2020 16:58:32 +0000 Subject: [PATCH] [#360][CI] fix docker build? --- .circleci/config.yml | 15 ++++++--------- Makefile | 2 ++ datashare-dist/src/main/docker/entrypoint.sh | 2 +- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e75f57bd0..d25b0b5a2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -58,14 +58,11 @@ jobs: - run: mvn -pl datashare-db liquibase:update - run: mvn test - run: mvn -Dmaven.test.skip=true package - - # making a datashare-dist-latest as we cannot access dist directory with a wildcard - run: - name: make dist dir - command: | - mkdir -p datashare-dist/target/datashare-dist-latest - cp -a datashare-dist/target/datashare-dist-*.*/* datashare-dist/target/datashare-dist-latest - + name: copy jar into dist dir + command: | + mkdir datashare-dist/target/datashare-dist-$CIRCLE_TAG/lib + cp datashare-dist/target/datashare-dist-$CIRCLE_TAG.jar datashare-dist/target/datashare-dist-$CIRCLE_TAG/lib/ - persist_to_workspace: root: /tmp/datashare paths: @@ -150,8 +147,8 @@ jobs: - run: name: build and push docker image command: | - cp -a /tmp/datashare/dist/ /tmp/datashare/datashare-dist/target/datashare-dist-latest/app - docker build -t icij/datashare:${CIRCLE_TAG} /tmp/datashare/datashare-dist/target/datashare-dist-latest/ + cp -a /tmp/datashare/dist/ /tmp/datashare/datashare-dist/target/datashare-dist-$CIRCLE_TAG/app + docker build -t icij/datashare:${CIRCLE_TAG} /tmp/datashare/datashare-dist/target/datashare-dist-$CIRCLE_TAG/ docker login -u ${DOCKER_USER} -p ${DOCKER_PASS} docker push icij/datashare:${CIRCLE_TAG} diff --git a/Makefile b/Makefile index 1d5b9409f..99bf0f1c0 100644 --- a/Makefile +++ b/Makefile @@ -25,6 +25,8 @@ release: docker: $(DIST_TARGET) cp -a $(PATH_TO_APP_DIST) $(DIST_TARGET)/app || exit 1 + mkdir -p $(DIST_TARGET)/lib + cp datashare-dist/target/*.jar $(DIST_TARGET)/lib/ docker build -t icij/datashare:$(VERSION) $(DIST_TARGET) unit: diff --git a/datashare-dist/src/main/docker/entrypoint.sh b/datashare-dist/src/main/docker/entrypoint.sh index d5b7b65a1..ba337d559 100755 --- a/datashare-dist/src/main/docker/entrypoint.sh +++ b/datashare-dist/src/main/docker/entrypoint.sh @@ -7,6 +7,6 @@ if [ "$1" = 'sh' ]; then exec "$@" else - CLASSPATH=$(ls /home/datashare/lib/) + CLASSPATH=$(find /home/datashare/lib -name "*.jar") exec java "${DS_JAVA_OPTS}" -DPROD_MODE=true -cp "/home/datashare/dist/:${CLASSPATH}" ${MAIN_CLASS} "$@" fi