-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrebuild.sh
More file actions
63 lines (55 loc) · 1.46 KB
/
rebuild.sh
File metadata and controls
63 lines (55 loc) · 1.46 KB
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
#!/bin/bash
# Usage: drop -- rebuild
set -e
main() {
echo "Re-build the codebase in $drop_docroot"
_build_codebase
echo "Re-sync sites direcroty if required"
_build_sites
echo "Re-build the profile if required"
_build_profile
}
_build_codebase() {
if [ "$config_makefile_path" ]
then
# Run the make files from within the docroot
if [ "$config_profile_name" ]; then
local _profile_makefile_path="$drop_docroot/profiles/$config_profile_name/drupal-org.make"
if [ -e "$_profile_makefile_path" ]; then
cd $drop_docroot
debug drush make $_profile_makefile_path . --no-core
else
echo "No makefile found inside the profile ($_profile_makefile_path)"
fi
fi
fi
return 0
}
_build_profile() {
[ "$config_deploy_profile" ] && _validate_profile
if [ "$config_deploy_profile" = "copy" ]
then
echo "Deploying profile from $config_profile_path"
rm -rf $drop_docroot/profiles/$config_profile_name
cp -r $config_profile_path/ $drop_docroot/profiles/$config_profile_name
rm -rf $drop_docroot/profiles/$config_profile_name/.git*
fi
return 0
}
_build_sites() {
if [ "$config_build_sitesdir" ]
then
if [ ! -d "$config_build_sitesdir" ]
then
echo "Sites directory was not found at $config_build_sitesdir"
exit 1
fi
echo "Syncing sites dir with $config_build_sitesdir"
chmod -R u+w $drop_docroot/sites
debug rsync -av $config_build_sitesdir/ $drop_docroot/sites
fi
return 0
}
main
echo "Re-build finished successfully."
return 0