forked from sanguis/drupal-beanstalk-post-deployment-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevelopment.sh
More file actions
executable file
·57 lines (45 loc) · 955 Bytes
/
development.sh
File metadata and controls
executable file
·57 lines (45 loc) · 955 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
57
#!/bin/bash
# how to run development.sh "%COMMENT%" %REVISION% %USER_NAME%
#echo $@\n
COMMENT=$1
DATE=$(date)
LOGFILE="$HOME/.beanstalk.log"
while getopts "123l:" opt; do
case $opt in
l)
echo "target $OPTARG"
LOGFILE=$OPTARG
echo "log: $LOGFILE"
;;
esac
done
if [[ $COMMENT =~ "-dbdump-" ]]; then
echo "Clearing cache"
drush sql-dump > /tmp/"$DATE"-bs-dump.sql
fi
if [[ $COMMENT =~ "-updb-" ]]; then
echo "Clearing cache"
drush -y updb
fi
if [[ $COMMENT =~ "-fra-" ]]; then
drush -y fra
fi
if [[ $COMMENT =~ "-bigups-" ]]; then
drush -y updb
drush -y fra
drush cc all
fi
if [[ $COMMENT =~ "-cc_all-" ]]; then
drush cc all
fi
if [[ $COMMENT =~ "-cc_cssjs-" ]]; then
drush cc ccs-js
fi
if [[ $COMMENT =~ "-cc_blocks-" ]]; then
drush cc block
fi
if [[ $COMMENT =~ "-rp-" ]]; then
drush php-eval 'node_access_rebuild();'
fi
# making local log
echo "deployed $2 on $DATE, by $3" >> $LOGFILE