-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·48 lines (42 loc) · 1.08 KB
/
build.sh
File metadata and controls
executable file
·48 lines (42 loc) · 1.08 KB
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
#!/bin/bash
if [ -z ${USER_UID:+x} ]
then
export USER_UID=`id -u`
export GROUP_GID=`id -g`
fi
clean () {
docker compose run --rm -u "$USER_UID:$GROUP_GID" gradle gradle clean
}
install() {
# docker compose run --rm -u "$USER_UID:$GROUP_GID" gradle gradle install publishToMavenLocal
docker compose run --rm -u "$USER_UID:$GROUP_GID" gradle gradle install
}
publish() {
if [ -e "?/.gradle" ] && [ ! -e "?/.gradle/gradle.properties" ]
then
echo "odeUsername=$NEXUS_ODE_USERNAME" > "?/.gradle/gradle.properties"
echo "odePassword=$NEXUS_ODE_PASSWORD" >> "?/.gradle/gradle.properties"
echo "sonatypeUsername=$NEXUS_SONATYPE_USERNAME" >> "?/.gradle/gradle.properties"
echo "sonatypePassword=$NEXUS_SONATYPE_PASSWORD" >> "?/.gradle/gradle.properties"
fi
docker compose run --rm -u "$USER_UID:$GROUP_GID" gradle gradle publish
}
for param in "$@"
do
case $param in
clean)
clean
;;
install)
install
;;
publish)
publish
;;
*)
echo "Invalid argument : $param"
esac
if [ ! $? -eq 0 ]; then
exit 1
fi
done