forked from genny-project/notes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpush.sh
More file actions
executable file
·30 lines (24 loc) · 809 Bytes
/
push.sh
File metadata and controls
executable file
·30 lines (24 loc) · 809 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
26
27
28
29
30
#!/bin/bash
version=$(prop 'git.build.version')
project=${PWD##*/}
file="src/main/resources/notes-git.properties"
function prop() {
grep "${1}=" ${file} | cut -d'=' -f2
}
if [ -z "${1}" ]; then
version="latest"
else
version="${1}"
fi
if [ -f "$file" ]; then
echo "$file found."
echo "git.commit.id = " "$(prop 'git.commit.id')"
echo "git.build.version = " "$(prop 'git.build.version')"
docker push gennyproject/${project}:"${version}"
docker tag gennyproject/${project}:"${version}" gennyproject/${project}:latest
docker push gennyproject/${project}:latest
docker tag gennyproject/${project}:"${version}" gennyproject/${project}:"$(prop 'git.build.version')"
docker push gennyproject/${project}:"$(prop 'git.build.version')"
else
echo "ERROR: git properties $file not found."
fi