Skip to content

Commit

Permalink
Permit ath-container.sh to be called cross-dir
Browse files Browse the repository at this point in the history
  • Loading branch information
olivergondza committed Feb 15, 2019
1 parent 96b0176 commit d2ed506
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ath-container.sh
Expand Up @@ -3,13 +3,15 @@
set -euo pipefail
trap 's=$?; echo "$0: Error $s on line "$LINENO": $BASH_COMMAND"; exit $s' ERR

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"

uid=$(id -u)
gid=$(id -g)
tag="jenkins/ath"
java_version="${java_version:-8}"

docker build --build-arg=uid="$uid" --build-arg=gid="$gid" src/main/resources/ath-container -t "$tag"
docker build --build-arg=uid="$uid" --build-arg=gid="$gid" "$DIR/src/main/resources/ath-container" -t "$tag"

run_opts="--interactive --tty --rm --publish-all --user ath-user --workdir /home/ath-user/ath-sources --shm-size 2g"
run_drive_mapping="-v /var/run/docker.sock:/var/run/docker.sock -v $(pwd):/home/ath-user/ath-sources -v ${HOME}/.m2/repository:/home/ath-user/.m2/repository"
run_opts="--interactive --tty --rm --publish-all --user ath-user --workdir /home/ath-user/sources --shm-size 2g"
run_drive_mapping="-v /var/run/docker.sock:/var/run/docker.sock -v $(pwd):/home/ath-user/sources -v ${HOME}/.m2/repository:/home/ath-user/.m2/repository"
docker run $run_opts $run_drive_mapping $tag /bin/bash -c "set-java.sh $java_version; bash"

0 comments on commit d2ed506

Please sign in to comment.