forked from rusakovichma/TicTaaC
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpush-docker.sh
More file actions
25 lines (22 loc) · 790 Bytes
/
push-docker.sh
File metadata and controls
25 lines (22 loc) · 790 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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