-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild_all_apps.sh
30 lines (26 loc) · 904 Bytes
/
build_all_apps.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
#!/bin/bash
spark_apps_dir=$(pwd)
echo ""
echo "Spark Apps Directory: $spark_apps_dir"
echo ""
build_logs_dir=${spark_apps_dir}/log
rm -r -f "${build_logs_dir}"
mkdir -p "${build_logs_dir}"
for application in *; do
if [ -d "$application" ]; then
spark_app_dir=${spark_apps_dir}/${application}
spark_app_pom_path=$spark_app_dir/pom.xml
if [ -f "$spark_app_pom_path" ]; then
spark_app_log=${build_logs_dir}/$application.log
mvn clean package -DskipTests -U -f "$spark_app_pom_path" > "${spark_app_log}"
build_success=$(cat "${spark_app_log}" | grep -i 'BUILD SUCCESS')
if [ -z "$build_success" ]; then
echo ""
echo "Build is failed for the application ${application} and log location is ${spark_app_log}"
else
rm -r -f "${spark_app_log}"
fi
fi
fi
done
echo ""