This repository has been archived by the owner on Nov 5, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·59 lines (40 loc) · 1.65 KB
/
build.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
#!/bin/bash
current_dir=$PWD;
echo "Enter the absolute path to the directory where you want to have the site build"
read build_dir;
if [ -z "$build_dir" ];
then
build_dir="${TMPDIR}culturefeed";
fi
echo "creating site in build_dir: $build_dir"
if [ -e $build_dir ]; then
# @todo first ask for confirmation to remove it
rm -Rf $build_dir;
fi
mkdir $build_dir;
cd $build_dir;
build_dir=$PWD;
drush make -y "${current_dir}/drupal-org-core.make";
mkdir profiles/culturefeed_kickstart;
cp -R "${current_dir}"/translations ./profiles/culturefeed_kickstart/translations;
cp -R "${current_dir}"/culturefeed_kickstart.info ./profiles/culturefeed_kickstart/culturefeed_kickstart.info;
cp -R "${current_dir}"/culturefeed_kickstart.install ./profiles/culturefeed_kickstart/culturefeed_kickstart.install;
cp -R "${current_dir}"/culturefeed_kickstart.profile ./profiles/culturefeed_kickstart/culturefeed_kickstart.profile;
cd profiles/culturefeed_kickstart;
drush make -y --no-core "${current_dir}/drupal-org.make";
mv sites/all/* ./
rm -Rf sites
cd $build_dir;
# Copy over composer.json and composer.lock.
cp "${current_dir}/support/composer."* .;
# Install dependencies with composer.
composer install --ignore-platform-reqs;
printf "\n" >> ./sites/default/default.settings.php
printf "/**\n" >> ./sites/default/default.settings.php
printf " * Include the autoloader generated by Composer.\n" >> ./sites/default/default.settings.php
printf " */\n" >> ./sites/default/default.settings.php
printf "require 'vendor/autoload.php';\n" >> ./sites/default/default.settings.php
# Switch back to working directory.
cd ${current_dir};
echo "build is available in ${build_dir}.";
exit;