-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplatform_update.sh
65 lines (55 loc) · 1.13 KB
/
platform_update.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
#!/bin/bash
#
# Wrapper script for our fabfile, to be called from Jenkins
#
# Where our fabfile is
FABFILE=/var/lib/jenkins/scripts/fabfile.py
FABKEY=/var/lib/jenkins/.ssh/id_rsa
HOST=$1
USER=$2
BUILD_NAME=$3
GENERAL_PLATFORM_NAME=$4
NO_ROBOTS_TXT=$5
if [[ -z $HOST ]]
then
echo "Missing args! Exiting"
exit 1
fi
if [[ -z $USER ]]
then
echo "Missing user argument! Exiting"
exit 1
fi
if [[ -z $BUILD_NAME ]]
then
echo "Missing args! Exiting"
exit 1
fi
if [[ -z $GENERAL_PLATFORM_NAME ]]
then
echo "Missing args! Exiting"
exit 1
fi
if [[ -z $NO_ROBOTS_TXT ]]
then
TASKS=(
generate_drupal_platform
provision_drupal_platform
migrate_drupal_platform
cache_drupal_platform_sites
)
else
TASKS=(
generate_drupal_platform
provision_drupal_platform
migrate_drupal_platform
cache_drupal_platform_sites
replace_robots_txt
)
fi
echo $BUILD_NAME
# Loop over each 'task' and call it as a function via the fabfile,
# with some extra arguments which are sent to this shell script by Jenkins
for task in ${TASKS[@]}; do
fab -f $FABFILE -H $HOST --user=$USER -i $FABKEY $task:build=$BUILD_NAME,platform=$GENERAL_PLATFORM_NAME || exit 1
done