-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.sh
executable file
·59 lines (52 loc) · 1.09 KB
/
build.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
MVN_OPTS="-Duser.home=/var/maven"
init() {
me=`id -u`:`id -g`
echo "DEFAULT_DOCKER_USER=$me" > .env
}
clean () {
docker compose run --rm maven mvn $MVN_OPTS clean
}
install() {
# TODO vertx4
docker compose run --rm maven mvn $MVN_OPTS install -DskipTests
}
test () {
docker compose run --rm maven mvn $MVN_OPTS test
}
publish() {
version=`docker compose run --rm maven mvn $MVN_OPTS help:evaluate -Dexpression=project.version -q -DforceStdout`
level=`echo $version | cut -d'-' -f3`
case "$level" in
*SNAPSHOT) export nexusRepository='snapshots' ;;
*) export nexusRepository='releases' ;;
esac
docker compose run --rm maven mvn $MVN_OPTS -DrepositoryId=ode-$nexusRepository -DskipTests --settings /var/maven/.m2/settings.xml deploy
}
for param in "$@"
do
case $param in
'--no-user')
;;
init)
init
;;
clean)
clean
;;
install)
install
;;
test)
test
;;
publish)
publish
;;
*)
echo "Invalid argument : $param"
esac
if [ ! $? -eq 0 ]; then
exit 1
fi
done