Created
August 8, 2017 21:24
-
-
Save jduckles/061cbad28f485b837b39259b3745d369 to your computer and use it in GitHub Desktop.
Script used to build SWC website from GitHub
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
SCRIPT='/home/data/sources/software-carpentry.org.sh' | |
LOG='/home/data/sources/software-carpentry.org.log' | |
DATE=`date` | |
echo '----------------' >> ${LOG} | |
echo ${DATE} >> ${LOG} | |
${SCRIPT} >> ${LOG} 2>&1 | |
root@server-03:/home/data/cron_scripts# cat /home/data/sources/software-carpentry.org.sh | |
#!/usr/bin/env bash | |
set -e | |
export LC_ALL='en_US.utf8' # cronjob env has it set wrong! | |
export PATH=$PATH:/usr/local/bin/ | |
SOURCE='/home/data/sources/software-carpentry.org' | |
SITE='/home/data/software-carpentry.org' | |
# Update, overwriting local changes. | |
cd "${SOURCE}" | |
git fetch --all | |
git reset --hard origin/gh-pages | |
# Rebuild data files and then the site. | |
make amy | |
make dashboard | |
make includes | |
jekyll build --config _config.yml | |
# Install. | |
rm -rf ${SITE}/* | |
mv ${SOURCE}/_site/* "${SITE}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment