This repository has been archived by the owner on Jul 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpackage.sh
executable file
·62 lines (52 loc) · 1.68 KB
/
package.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
# =============================================================================
# Preamble
# =============================================================================
set -e
MAIN_DIR="$(dirname "$BASH_SOURCE")"
cd "$MAIN_DIR"
SCRIPTDIR="$(pwd -P)"
# =============================================================================
usage() {
echo "usage: [MVN=[path to maven]] ./package.sh [-r] [-w fromscratch/working/directory]"
echo " if MVN isn't set then the script assumes \"mvn\" is on the command line PATH"
echo ""
echo " -w : The working directory given to fromscratch.sh. This defaults."
echo " --deploy : do a \"mvn deploy\" as part of building."
echo " --offline : Pass -o to maven."
exit 1
}
if [ "$MVN" = "" ]; then
MVN=mvn
fi
WORKING_DIRECTORY=/tmp/tensorflow
MVN_TARGET=install
MVN_OFFLINE=
while [ $# -gt 0 ]; do
case "$1" in
"-w")
WORKING_DIRECTORY=$2
shift
shift
;;
"--deploy")
MVN_TARGET=deploy
shift
;;
"--offline")
MVN_OFFLINE=-o
shift
;;
*)
usage
;;
esac
done
if [ ! -f "$WORKING_DIRECTORY"/tensorflow.version ]; then
echo "ERROR: The expected artifact from the build \"$WORKING_DIRECTORY/tensorflow.version\" is missing. Did you execute a build using \"fromscratch.sh\"?"
exit 1
fi
TENSORFLOW_VERSION=`cat "$WORKING_DIRECTORY"/tensorflow.version`
$MVN $MVN_OFFLINE versions:set -DnewVersion=$TENSORFLOW_VERSION
$MVN $MVN_OFFLINE -Dfromscratch.working.dir="$WORKING_DIRECTORY" clean $MVN_TARGET
$MVN $MVN_OFFLINE versions:set -DnewVersion=0