-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackageStormForDeploy.sh
More file actions
executable file
·73 lines (65 loc) · 2.03 KB
/
packageStormForDeploy.sh
File metadata and controls
executable file
·73 lines (65 loc) · 2.03 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/usr/bin/env bash
# default values for variables
process_path="examples/alexey-queues.xml"
run=false
build=false
nimbus="localhost"
flinkmainclass="flink.deploy"
# handle the argument options
function USAGE {
echo ""
echo "Usage:"
echo "-p <path to XML process file> if not defined default value will be used"
echo "-n <nimbus host ip adress> localhost as default"
echo "-m <flink.deploy|flink.run> define mainclass to deploy or run local cluster"
echo "-r run the deployment process"
echo "-b build new packages"
exit 1
}
while getopts ":p:n:m: :rb" optname
do
case "$optname" in
"p") process_path=$OPTARG;;
"r") run=true;;
"b") build=true;;
"n") nimbus=$OPTARG;;
"m") flinkmainclass=$OPTARG;;
"?") USAGE;;
":")
echo "No argument value for option $OPTARG"
USAGE
;;
*)
echo "Unknown error while processing options"
USAGE
;;
esac
done
echo ""
echo "Using following process as topology: $process_path"
echo "Rebuild: $build"
echo "Running: $run"
echo "Nimbus host: $nimbus"
echo "Storm mainclass: $flinkmainclass"
# stop and print the usage if both r and b were not set
# or if mainclass is set to sth different then flink.{deploy,run}
if ( ( [ ${run} == "false" ] ) && ( [ ${build} == "false" ] ) ) || \
( [[ ! ${flinkmainclass} =~ ^flink\.(deploy|run)$ ]] ) ; then
USAGE
fi
# rebuild (package) the needed jars
if ${build}; then
# package for deployment
mvn -P deploy,standalone package -DskipTests
# package for local start
mvn -Dflink.mainclass=${flinkmainclass} -P standalone,!deploy package -DskipTests
fi
# run the deployment process
if ${run}; then
# start the deployment
java -jar \
-Dnimbus.host=${nimbus} \
-Dstorm.jar=target/streams-flink-0.9.25-SNAPSHOT-flink-provided.jar \
target/streams-flink-0.9.25-SNAPSHOT-flink-compiled.jar \
${process_path}
fi