-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathbuildDockerAndPush.sh
executable file
·44 lines (36 loc) · 1.17 KB
/
buildDockerAndPush.sh
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
###############################################################################################
# ./build.sh : Build all project
# ./build.sh project_example : Build project_example
###############################################################################################
# fail fast
set -e
cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
#if no version is set let's use the environment name
if [ -z ${image_version} ]; then
image_version=$(mvn -q -Dexec.executable='echo' -Dexec.args='${project.version}' --non-recursive exec:exec)
fi
function build() {
echo build all project
time mvn clean package
}
function push() {
echo push skalogs/$1:${image_version}
docker push skalogs/$1:${image_version}
echo skalogs/$1:${image_version} is pushed
}
function buildAll() {
build
for folder in process-importer retry-importer error-importer etl-backend referential-importer simulate enduser-doc ; do
push $folder
done
echo build all finish !
}
if [ $1 ]; then
time mvn clean package
echo push skalogs/$1:${image_version}
docker push skalogs/$1:${image_version}
echo skalogs/$1:${image_version} is pushed
else
buildAll
fi