-
Notifications
You must be signed in to change notification settings - Fork 36
/
getClients.sh
executable file
·168 lines (116 loc) · 3.59 KB
/
getClients.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
#!/bin/bash
# This thing connects to box, checks the latest builds and downloads the client tools
#
# These are the variables that need to be set
#
#BOX_PASSWORD=XXXXXX
if [ -z $BOX_USER ]
then
echo The following variables have to be set:
echo BOX_USER
echo BOX_PASSWORD
echo "Optionally, override BOX_URL (set to ftp.box.com/CI)"
exit 1
fi
#VERSIONS=()
VERSIONS=(8.1-QAT 9.0-QAT)
BOX_URL=${BOX_URL:-ftp.box.com/CI}
DIR=clients
## Print a quick status of current dir
## I uncommented this cause it's mostly useless
# if ! [ -d $DIR ]
# then
# echo No local client tools found
# echo
# else
# echo Latest build found for client tools: $( ls -d $DIR/*/ | cut -f2 -d'/' | sort -n -r | head -n 1 )
# fi
# Stable builds
echo Release available - Branch: 5.4.0.9 , Buind number: 162
echo Release available - Branch: 6.0.1.0 , Buind number: 386
echo Release available - Branch: 7.0.0.0 , Buind number: 25
echo Release available - Branch: 7.1.0.0 , Buind number: 12
echo Release available - Branch: 8.0.0.0 , Buind number: 28
echo Release available - Branch: 8.1.0.0 , Buind number: 365
echo Release available - Branch: 8.2.0.0 , Buind number: 342
echo Release available - Branch: 8.3.0.0 , Buind number: 371
# Get list of files
echo ... connecting to box to get the nightlies
for i in ${VERSIONS[@]}; do
result=$(lftp -c "open -u $BOX_USER,$BOX_PASSWORD $BOX_URL ; cls -1 --sort date $i | head -n 1");
BRANCH=$(echo $result | cut -f1 -d/)
BUILD=$(echo $result | cut -f2 -d/)
echo Nightly available - Branch: $BRANCH , Build number: $BUILD
done
echo
# Ask for branch
read -e -p "Which branch to download from? [$BRANCH]: " branch
branch=${branch:-$BRANCH}
# Ask for buildno
read -e -p "Which build number? [$BUILD]: " buildno
buildno=${buildno:-$BUILD}
PRODUCTS=(pdi-ee-client pdi-ce prd-ee prd-ce pme-ee pme-ce psw-ee psw-ce pad-ee pad-ce)
echo Available client tools
echo
i=0
for p in ${PRODUCTS[@]}
do
echo [$i]: $p
((i++))
done
echo
# Ask for product
read -e -p "Which client tool to download? [0]: " productIdx
product=${PRODUCTS[$productIdx]}
if [ -z $product ]
then
echo Invalid selection
exit 1
fi
path="ee"
appender="-dist"
IS_DIST=1
if [[ $product =~ ce ]]; then
echo " -- You selected a CE product"
path="ce"
appender=""
IS_DIST=0
fi
tooldir=$DIR/$product/$branch/$buildno/
echo you selected $product. Downloading to $tooldir
if [ -d $tooldir ]
then
echo Dir already exists. Won\'t download again
exit 1
else
mkdir -p $tooldir
fi
# Downloading. We need to take into account the fact that mondrian stuff doesnt respect the same naming pattern
# Also - don't download mac stuff
lftp -c "lcd $tooldir; open -u $BOX_USER,$BOX_PASSWORD $BOX_URL ; \
cd $branch/$buildno/$path/client-tools; \
mget $product-[^m]*-$buildno$appender.zip \
";
unzip $tooldir/$product-*-$buildno$appender.zip -d $tooldir
if [ $IS_DIST == "1" ]
then
echo Installing $dir...
pushd $tooldir > /dev/null
cd $prod*/
cat <<EOT > auto-install.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<AutomatedInstallation langpack="eng">
<com.pentaho.engops.eula.izpack.PentahoHTMLLicencePanel id="licensepanel"/>
<com.izforge.izpack.panels.target.TargetPanel id="targetpanel">
<installpath>../</installpath>
</com.izforge.izpack.panels.target.TargetPanel>
<com.izforge.izpack.panels.install.InstallPanel id="installpanel"/>
</AutomatedInstallation>
EOT
java -jar installer.jar auto-install.xml > /dev/null
popd > /dev/null
fi
rm -rf $tooldir/$product-*-$buildno*
echo Done. You may want to use the ./startClient.sh command
exit 0