oliverdavies.uk/publish.sh

19 lines
485 B
Bash
Raw Normal View History

2015-11-30 23:10:03 +00:00
#!/bin/bash
2015-12-29 08:43:30 +00:00
ENV=prod
DEPLOY_USER=deployment
DEPLOY_HOST=www.oliverdavies.uk
2015-12-30 17:22:43 +00:00
DEPLOY_PATH=/var/www/oliverdavies/public
2015-12-29 08:43:30 +00:00
2016-01-11 01:44:07 +00:00
# Rebuild assets.
gulp build --production
2015-12-29 08:43:30 +00:00
./vendor/bin/sculpin generate --env=${ENV} --clean --no-interaction
2015-11-30 23:10:03 +00:00
if [ $? -ne 0 ]; then echo "Could not generate the site"; exit 1; fi
2016-01-11 02:28:43 +00:00
# Minify HTML.
gulp minify-prod-html
2015-12-29 08:43:30 +00:00
rsync -av --delete output_${ENV}/ ${DEPLOY_USER}@${DEPLOY_HOST}:${DEPLOY_PATH}
2015-11-30 23:10:03 +00:00
if [ $? -ne 0 ]; then echo "Could not publish the site"; exit 1; fi