Skip to content
Snippets Groups Projects
Commit 5300ac22 authored by Eric Bremner's avatar Eric Bremner Committed by Liam Morland
Browse files

ISTWCMS-4835: Update build_gesso.sh to allow building only gesso_helper

parent f0a01642
No related branches found
No related tags found
1 merge request!53ISTWCMS-4835: Move gesso_helper
build_option=${1:-1}
gesso_version="8.x-3.2"
git clone --branch $gesso_version https://git.uwaterloo.ca/drupal-org/gesso.git
HTML_PATH=${2:-"/var/www/html"}
DRUPAL_PATH=${3:-/var/www/drupal8}
gesso_version=${4:-"8.x-3.2-uw_wcms1"}
if [ -f "gulpfile.js" ]; then
cp gulpfile.js gesso
if [[ -L "$HTML_PATH/uw_wcms_gesso" ]]; then
echo ""
echo "*************************************************************************"
echo "Removing old gesso symlink ..."
rm -rf "$HTML_PATH/uw_wcms_gesso"
echo "Done removing old gesso symlink."
echo "**************************************************************************"
echo ""
fi
if [ -f "package.json" ]; then
cp package.json gesso
fi
cd "$DRUPAL_PATH/web/profiles/uw_base_profile/modules/custom/uw_wcms_gesso"
echo "Removing Gesso files"
rm gesso.layouts.yml
rm gesso.info.yml
rm gesso.libraries.yml
rm gesso.breakpoints.yml
rm Dockerfile
rm screenshot.png
rm -rf templates
echo "Done removing gesso theme files."
echo "Running npm install ..."
cd gesso
npm install
echo "Done npm install."
echo "Symbolic linking source directory ..."
if [ -d "source" ]; then
echo "Removing old source directory ..."
rm -rf source
echo "Done removing old source directory ..."
if [[ -d gesso ]]; then
echo "**************************************************************************************"
echo "Removing old gesso ..."
rm -rf gesso
echo "Done removing old gesso."
echo "**************************************************************************************"
echo ""
fi
ln -fs "../source" source
echo "Done symbolic linking source directory ..."
echo "Removing style lint config and replacing with UW config ..."
rm .stylelintrc.yml
cp ../.stylelintrc.yml .
echo "Done removing style lint config and replacing with UW config"
git clone --branch $gesso_version https://git.uwaterloo.ca/drupal-org/gesso.git
if [[ $build_option == 1 || $build_option == 3 ]]; then
if [ -f "gulpfile.js" ]; then
cp gulpfile.js gesso
fi
if [ -f "package.json" ]; then
cp package.json gesso
fi
echo "**************************************************************************************"
echo "Removing Gesso files ..."
rm gesso/gesso.layouts.yml
rm gesso/gesso.info.yml
rm gesso/gesso.libraries.yml
rm gesso/gesso.breakpoints.yml
rm gesso/Dockerfile
rm gesso/screenshot.png
rm -rf gesso/templates
echo "Done removing gesso theme files."
echo "**************************************************************************************"
echo ""
echo "Running gulp build ..."
gulp build
echo "Done running gulp build."
echo "**************************************************************************************"
echo "Running npm install ..."
cd gesso
npm install
echo "Done npm install."
echo "**************************************************************************************"
echo ""
echo "**************************************************************************************"
echo "Symbolic linking source directory"
if [ -d "source" ]; then
echo ""
echo "**************************************************************************************"
echo "Removing old source directory ..."
rm -rf source
echo "Done removing old source directory."
echo "**************************************************************************************"
echo ""
fi
ln -fs "../source" source
echo "Done symbolic linking source directory."
echo "**************************************************************************************"
echo ""
echo "**************************************************************************************"
echo "Removing style lint config and replacing with UW config ..."
rm .stylelintrc.yml
cp ../.stylelintrc.yml .
echo "Done removing style lint config and replacing with UW config."
echo "**************************************************************************************"
echo ""
echo "**************************************************************************************"
echo "Running gulp build ..."
gulp build
cd ..
echo "Done running gulp build."
echo "**************************************************************************************"
echo ""
echo "**************************************************************************************"
echo "Creating symlink for gesso ..."
cd $HTML_PATH
if [[ $build_option == 1 ]]; then
ln -s "$DRUPAL_PATH"/web/profiles/uw_base_profile/modules/custom/uw_wcms_gesso uw_wcms_gesso
else
ln -s ../web/profiles/uw_base_profile/modules/custom/uw_wcms_gesso uw_wcms_gesso
fi
echo "Done creating symlink for gesso."
echo "**************************************************************************************"
echo ""
else
echo "**************************************************************************************"
echo "Setting up gesso helper ..."
mv gesso/gesso_helper .
rm -rf gesso/*
mv gesso_helper gesso
echo "Done setting up gesso helper"
echo "**************************************************************************************"
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment