oliverdavies.uk/publish.sh
2016-01-11 02:28:43 +00:00

19 lines
485 B
Bash
Executable file

#!/bin/bash
ENV=prod
DEPLOY_USER=deployment
DEPLOY_HOST=www.oliverdavies.uk
DEPLOY_PATH=/var/www/oliverdavies/public
# Rebuild assets.
gulp build --production
./vendor/bin/sculpin generate --env=${ENV} --clean --no-interaction
if [ $? -ne 0 ]; then echo "Could not generate the site"; exit 1; fi
# Minify HTML.
gulp minify-prod-html
rsync -av --delete output_${ENV}/ ${DEPLOY_USER}@${DEPLOY_HOST}:${DEPLOY_PATH}
if [ $? -ne 0 ]; then echo "Could not publish the site"; exit 1; fi