This repository has been archived by the owner on Sep 24, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathupdate
executable file
·64 lines (54 loc) · 1.61 KB
/
update
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
#!/usr/bin/env bash
CUR_STABLE="$(ls -lt stable/features/org.openbel.workbench*.jar \
| egrep -o "[0-9]+.jar" \
| cut -d '.' -f1 \
| head -n 1)"
if [ ! -z "${CUR_STABLE}" ]; then
echo -en "Relocating current stable to ${CUR_STABLE}... "
if [ ! -d "${CUR_STABLE}" ]; then
cp -a "stable" "${CUR_STABLE}"
fi
echo -en "okay\n"
fi
echo -en "Recreating stable and unstable... "
rm -fr stable unstable
mkdir -p stable unstable
echo -en "okay\n"
### UNSTABLE ###
echo
echo -en "Updating unstable.\n"
# GRAB IT FROM BAMBOO
BUILD_KEY="browse/BELEDITOR-BUILDUNSTABLE"
ARTIFACT="unstable-repository.zip"
LATEST="${BUILD_KEY}/latestSuccessful/artifact/JOB1/repository-zip/${ARTIFACT}"
wget --quiet http://ci.selventa.com/${LATEST} || exit 1
echo "Got $(/bin/ls -sh ${ARTIFACT} | awk '{ print $1 }') from Bamboo."
# EXTRACT IT
echo -en "Extracting... "
cd unstable || exit 1
unzip -oqq ../${ARTIFACT}
cd - >/dev/null || exit 1
echo "okay"
# WACK THE ARTIFACT
echo -en "Removing artifact... "
rm ${ARTIFACT} || exit 1
echo "okay"
### STABLE ###
echo
echo -en "Updating stable.\n"
# GRAB IT FROM BAMBOO
BUILD_KEY="browse/BELEDITOR-BUILDSTABLE"
ARTIFACT="stable-repository.zip"
LATEST="${BUILD_KEY}/latestSuccessful/artifact/JOB1/repository-zip/${ARTIFACT}"
wget --quiet http://ci.selventa.com/${LATEST} || exit 1
echo "Got $(/bin/ls -sh ${ARTIFACT} | awk '{ print $1 }') from Bamboo."
# EXTRACT IT
echo -en "Extracting... "
cd stable || exit 1
unzip -oqq ../${ARTIFACT}
cd - >/dev/null || exit 1
echo "okay"
# WACK THE ARTIFACT
echo -en "Removing artifact... "
rm ${ARTIFACT} || exit 1
echo "okay"