-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
95de790
commit 317d604
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash -e | ||
|
||
VERSION=$(mvn -q \ | ||
-Dexec.executable="echo" \ | ||
-Dexec.args='${project.version}' \ | ||
--non-recursive \ | ||
org.codehaus.mojo:exec-maven-plugin:1.3.1:exec) | ||
|
||
FILE=./target/tic-taac-$VERSION-release.zip | ||
if [ -f "$FILE" ]; then | ||
docker build . --build-arg VERSION=$VERSION -t rusakovichma/tic-taac:$VERSION | ||
if [[ ! $VERSION = *"SNAPSHOT"* ]]; then | ||
docker tag rusakovichma/tic-taac:$VERSION rusakovichma/tic-taac:latest | ||
fi | ||
else | ||
echo "$FILE does not exist - run 'mvn package' first" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash -e | ||
|
||
VERSION=$(mvn -q \ | ||
-Dexec.executable="echo" \ | ||
-Dexec.args='${project.version}' \ | ||
--non-recursive \ | ||
org.codehaus.mojo:exec-maven-plugin:1.3.1:exec) | ||
|
||
if [[ $VERSION = *"SNAPSHOT"* ]]; then | ||
echo "Do not publish a snapshot version of tic-taac" | ||
exit 1 | ||
fi | ||
docker inspect --type=image rusakovichma/tic-taac:$VERSION > /dev/null 2>&1 | ||
if [[ "$?" -ne 0 ]] ; then | ||
echo "docker image rusakovichma/tic-taac:$VERSION does not exist - run build_docker.sh first" | ||
exit 1 | ||
fi | ||
docker inspect --type=image rusakovichma/tic-taac:latest > /dev/null 2>&1 | ||
if [[ "$?" -ne 0 ]] ; then | ||
echo "docker image rusakovichma/tic-taac:latest does not exist - run build_docker.sh first" | ||
exit 1 | ||
fi | ||
|
||
docker push rusakovichma/tic-taac:$VERSION | ||
docker push rusakovichma/tic-taac:latest |