Reprise build.sh Commerce Kickstart
[drupal/global/profiles/fonamental.git] / scripts / build.sh
1 #!/bin/bash
2 set -xe
3
4 PREFIX=fonamental
5 BUILD_PREFIX=build
6 TRANSLATIONS="fr"
7 PROFILE_NAME=$PREFIX
8 DESTINATION=${BUILD_PREFIX}/$PREFIX
9 TEMP_NOCORE=${BUILD_PREFIX}/tmp_nocore
10 TEMP_BUILD=${BUILD_PREFIX}/tmp_build
11 THEME_NAME=${PREFIX}_theme
12 THEME_DIR=$DESTINATION/profiles/$PROFILE_NAME/themes/custom/$THEME_NAME
13
14 if which drush6; then
15 DRUSH=drush6
16 else
17 DRUSH=drush
18 fi
19
20 if [ ! -f drupal-org.make ]; then
21 echo "[error] Run this script from the distribution base path."
22 exit 1
23 fi
24
25 # Clean up previous build
26 rm -rf $BUILD_PREFIX
27 mkdir $BUILD_PREFIX
28
29 # Build the profile.
30 $DRUSH make --translations=$TRANSLATIONS --no-core --contrib-destination drupal-org.make $TEMP_NOCORE
31
32 # Build the distribution and copy the profile in place.
33 $DRUSH make drupal-org-core.make $TEMP_BUILD
34
35 # Assemble platform
36 cp -r $TEMP_NOCORE $TEMP_BUILD/profiles/$PROFILE_NAME
37 rm -rf $TEMP_NOCORE
38 cp -r `ls -A | grep -v $BUILD_PREFIX` $TEMP_BUILD/profiles/$PROFILE_NAME
39 mv $TEMP_BUILD $DESTINATION
40
41 # Compile SASS stylesheets
42 (cd $THEME_DIR; compass compile)
43
44 echo "done"