Skip to content

Commit

Permalink
[#360][CI] fix docker build?
Browse files Browse the repository at this point in the history
  • Loading branch information
bamthomas committed Feb 26, 2020
1 parent f87da8c commit 493cd78
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
15 changes: 6 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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}
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion datashare-dist/src/main/docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 493cd78

Please sign in to comment.