mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-16 10:48:47 +00:00
25 lines
1022 B
Bash
Executable File
25 lines
1022 B
Bash
Executable File
#!/bin/bash
|
|
release=$1
|
|
if [ "${release}" = "" ]; then
|
|
SET_LATEST=1
|
|
release=$(wget -O - http://releases.sapsailing.com/ 2>/dev/null | grep 'build-[0-9]\{10\}' | tail -1 | sed -e 's/^.*\(build-[0-9]*\).*$/\1/')
|
|
echo Latest release is ${release}
|
|
fi
|
|
GITROOT="`dirname $0`/.."
|
|
DOCKERDIR="${GITROOT}/docker"
|
|
DOCKERFILE="$DOCKERDIR/Dockerfile"
|
|
echo "Copying files from GITROOT $GITROOT into Docker workspace"
|
|
cp "$GITROOT/java/target/env.sh" "$DOCKERDIR"
|
|
cp "$GITROOT/java/target/start" "$DOCKERDIR"
|
|
cp "$GITROOT/java/target/configuration/JavaSE-11.profile" "$DOCKERDIR"
|
|
cd "$DOCKERDIR"
|
|
docker build --build-arg RELEASE=${release} -t sapsailing:${release} .
|
|
echo "Cleaning up..."
|
|
rm start env.sh JavaSE-11.profile Dockerfile
|
|
docker tag sapsailing:${release} docker.sapsailing.com/sapsailing:${release}
|
|
docker push docker.sapsailing.com/sapsailing:${release}
|
|
if [ "$SET_LATEST" = "1" ]; then
|
|
docker tag sapsailing:${release} docker.sapsailing.com/sapsailing:latest
|
|
docker push docker.sapsailing.com/sapsailing:latest
|
|
fi
|