-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_uber_jar.sh
43 lines (35 loc) · 1.01 KB
/
build_uber_jar.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
#!/bin/bash
set -ex
SBT_PROJECT_DIR=$1 # ../etl-ml-pieces.scala
PACKAGES_DIR=$2 # /tmp/workdir/PACKAGES
# debug
echo SBT_PROJECT_DIR ${SBT_PROJECT_DIR}
echo PACKAGES_DIR ${PACKAGES_DIR}
pwd
ls -la
whoami
env
java -version
javac -version
if [ ! -f "${SBT_PROJECT_DIR}/build.sbt" ]; then
echo "Unknown sbt project, check the first argument"
exit 1
fi
if [ -z "${PACKAGES_DIR}" ]; then
echo "Target dir must be given, check the second argument"
fi
export JAVA_OPTS="${JAVA_OPTS} -Dsbt.log.noformat=true"
pushd "${SBT_PROJECT_DIR}"
timeout -v -k 5s 10m sbt -v --mem 4096 clean compile test assembly
# timeout -v -k 5s 3m sbt -v --mem 4096 clean
# timeout -v -k 5s 5m sbt -v --mem 4096 compile
# timeout -v -k 5s 10m sbt -v --mem 4096 test
# timeout -v -k 5s 3m sbt -v --mem 4096 assembly
# -k duration
# --kill-after=duration
popd
mkdir -p ${PACKAGES_DIR}
cp "${SBT_PROJECT_DIR}/target/scala-2.11/*.jar" ${PACKAGES_DIR}
# target/scala-2.11/etl-ml-pieces-1923-assembly-0.1.0.jar
# debug
ls -lh ${PACKAGES_DIR}