-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathdeploy.sh
52 lines (44 loc) · 938 Bytes
/
deploy.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
#!/bin/bash
set -e
FILES="
graph-query-ir/pom.xml
pgql-lang/pom.xml
"
if [ $# -eq 0 ]
then
echo "ERROR: Please specify a version number, for example, 'bash deploy.sh 2017-01-01'."
exit
fi
if [ -f pgql-lang/src/main/resources/pgql.spoofax-language ]
then
echo "INFO: Using the parser that was previously built via 'bash install.sh'"
else
echo "ERROR: Run 'bash install.sh' first."
exit
fi
STAGE=false
if [[ "$1" =~ ^[0-9.]+$ ]]
then
echo "Deploying to release repo"
else
echo "Deploying to staging repo"
STAGE=true
fi
VERSION_A="0.0.0-SNAPSHOT"
VERSION_B="$1"
for f in $FILES
do
sed -i.bak "s/$VERSION_A/$VERSION_B/g" $f
if $STAGE
then sed -i.bak "s/release-local/stage-local/g" $f
fi
done
cd graph-query-ir/; mvn deploy; cd ../
cd pgql-lang/; mvn deploy; cd ../
for f in $FILES
do
sed -i.bak "s/$VERSION_B/$VERSION_A/g" $f
if $STAGE
then sed -i.bak "s/stage-local/release-local/g" $f
fi
done