-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplatformSnapshot.sh
More file actions
executable file
·56 lines (44 loc) · 957 Bytes
/
platformSnapshot.sh
File metadata and controls
executable file
·56 lines (44 loc) · 957 Bytes
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
#!/bin/bash
superDir=~/sonarVersions
sourceDir=sonar-application/build/distributions
# update sources
out=$(git pull origin)
echo $out
# build snapshot
/bin/bash ./build.sh -x test
if [ $? != 0 ]
then
echo
echo QUICK BUILD SCRIPT FAILED
exit
fi
# calculate version
ver=$(ls ${sourceDir}/sonar-application-*-SNAPSHOT.zip)
len=${#sourceDir}+19 #+19 for /sonar-application-
ver=${ver:$len}
len=${#ver}-4 #-4 for .zip
ver=${ver:0:$len}
if [ ! -f ${sourceDir}/sonar-application-${ver}.zip ]
then
echo
echo BUILD FAILED
exit
fi
# copy, expand, delete zip
cp ${sourceDir}/sonar-application-${ver}.zip ${superDir}/.
cd ${superDir}
unzip sonar-application-${ver}.zip
rm sonar-application-${ver}.zip
echo
echo ver: ${ver}
echo
# start server
if [[ -d sonarqube-${ver} ]]
then
mv default.txt default.bak
echo $ver > default.txt
touch sonarqube-${ver}/logs/sonar.log
/bin/bash ~/scripts/start.sh ${ver}
else
echo Deploy failed
fi