-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsite-update
executable file
·94 lines (78 loc) · 2.72 KB
/
site-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
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
#!/bin/bash
# site-update
#
# Script de mise à jour d'un site
#
# Pour mettre à jour un site :
# - modifier le fichier .make du profil d'installation
# - ./site-update
# Stop on error
set -e
# Define colors
RED="\e[00;31m"
YELLOW="\e[01;33m"
GREEN="\e[00;32m"
NOCOLOR="\e[00m"
# Get informations to build site
SITE_TO_BUILD=$1
if [ -z "$1" ]; then
echo -e "${RED}You must pass a site to build as first parameter.${NOCOLOR}"
exit 0;
fi
# Display ASCII Cheese
echo ""
echo -e "${YELLOW} _--'-. ${NOCOLOR}"
echo -e "${YELLOW} .-' '-. ${NOCOLOR}"
echo -e "${YELLOW} |''--.. '-. ${NOCOLOR}"
echo -e "${YELLOW} | ''--.. '-. ${NOCOLOR}"
echo -e "${YELLOW} |.-. .-'. ''--..'.${NOCOLOR}"
echo -e "${YELLOW} |'./ -_' .-. |${NOCOLOR}"
echo -e "${YELLOW} | .-. '.-' .-'${NOCOLOR}"
echo -e "${YELLOW} '--.. '.' .- -. ${NOCOLOR}"
echo -e "${YELLOW} ''--.. '_' :${NOCOLOR}"
echo -e "${YELLOW} ''--.. |${NOCOLOR}"
echo -e "${YELLOW} ''-'${NOCOLOR}"
echo ""
echo "======================"
echo "== Fromages =="
echo "======================"
# call default vars
. `pwd`/vars/default
# and override with local vars
FILE=vars/$SITE_TO_BUILD
if [ -f $FILE ]; then
. $WORKSPACE/$FILE
else
echo -e "${YELLOW}File $FILE does not exist, used default values.${NOCOLOR}"
fi
cd $DRUPAL_ROOT
echo "This command can be used to rebuild the installation profile in place. Be careful as it will wipe out contrib and custom modules."
echo " [1] Rebuild profile in place in release mode (latest stable release)"
echo " [2] Rebuild profile in place in development mode (latest dev code with .git working-copy)"
echo "Selection:"
read SELECTION
if [ $SELECTION = "1" ]; then
echo -e "${GREEN}Building install profile in release mode...${NOCOLOR}"
drush make --no-gitinfofile $WORKSPACE/$SITE_PROFILE/build/$MAKEFILE.make .
elif [ $SELECTION = "2" ]; then
echo -e "${GREEN}Building install profile in development mode (latest dev code with .git working-copy)...${NOCOLOR}"
drush make --working-copy --no-gitinfofile $WORKSPACE/$SITE_PROFILE/build/$MAKEFILE.make .
else
echo -e "${RED}Invalid selection.${NOCOLOR}"
exit 0
fi
# # Get site environment
# DRUPAL_ENV=`drush vget environment --format=string`
# echo 'Environment to be deployed: '$DRUPAL_ENV
# # Copy environment settings file from source repository to Drupal folder
# cp $WORKSPACE/deploy/env/settings.$DRUPAL_ENV.php $DRUPAL_ROOT/sites/default/settings.$DRUPAL_ENV.php
# echo "Update environment settings file settings.$DRUPAL_ENV.php"
# # Apply environment configuration
# drush d-conf
# Apply hook_update_N()
drush updb -y
# Revert features just to be sure
drush fra -y
# Clear all cache
drush cc all
exit 0;