-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentrypoint.sh
executable file
·42 lines (35 loc) · 1.03 KB
/
entrypoint.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
#!/bin/bash -x
# Print system information
mvn -version
java --version
javac -version
SOURCE_DIR=/source/
OUTPUT_DIR=/output/
BUILD_OPTS_DEFAULT="-Dnoredist -DskipTests -Dsystemvm-kvm -Dsystemvm-xen -Dsystemvm-vmware -T2"
SOURCE=${SOURCE:-}
VERSION=${VERSION:-}
BUILD_OPTS=${BUILD_OPTS:-$BUILD_OPTS_DEFAULT}
if [[ $SOURCE =~ http.* ]] || [[ $SOURCE =~ git.* ]]; then
if [ -d "$SOURCE_DIR" ]; then
echo "$SOURCE_DIR already exists in the container"
exit 1
fi
git clone $SOURCE $SOURCE_DIR
elif [ -z "$SOURCE_DIR" ] || [ ! -d "$SOURCE_DIR" ] || [ ! -f "$SOURCE_DIR/pom.xml" ]; then
echo "Source $SOURCE_DIR does not exist in the container"
exit 1
fi
if [ ! -d "$OUTPUT_DIR" ]; then
echo "$OUTPUT_DIR does not exist in the container"
exit 1
fi
cd $SOURCE_DIR
if [ ! -z "$VERSION" ]; then
git checkout $VERSION
fi
# Packaging
ACS_BUILD_OPTS=$BUILD_OPTS packaging/build-deb.sh
mv $SOURCE_DIR/../cloudstack-*.deb $OUTPUT_DIR
if [[ $SOURCE =~ http.* ]] || [[ $SOURCE =~ git.* ]]; then
rm -rf $SOURCE_DIR
fi