#!/bin/bash
DOMAIN=[domain-name]
GIT_REPO=/var/repos/[repo-name].repo.git
WORKING_DIRECTORY=/tmp/$DOMAIN
PUBLIC_WWW=/var/www/$DOMAIN
BACKUP_WWW=/tmp/$DOMAIN-backup
set -e
rm -rf $WORKING_DIRECTORY
rsync -aqz $PUBLIC_WWW/ $BACKUP_WWW
trap "echo 'A problem occurred. Reverting to backup.'; rsync -aqz --del $BACKUP_WWW/ $PUBLIC_WWW; r
m -rf $WORKING_DIRECTORY" EXIT
git clone $GIT_REPO $WORKING_DIRECTORY
git clone https://github.com/[them] $WORKING_DIRECTORY/themes/beautifulhugo
# The following section should be changed to use rsync so that it nicely updates
# the directory instead of making it blank.
rm -rf $PUBLIC_WWW/*
hugo -s $WORKING_DIRECTORY -d $PUBLIC_WWW -b "http://${DOMAIN}"
rm -rf $WORKING_DIRECTORY
Merge a hot fix from Master back into Dev branch
How to Merge a Hotfix from Master back in to Dev
[Read More]
Prevent CPAN-Testers from testing under certain OS
How to exclude some OS from being tested in the cpantester network.
[Read More]
How to change your git commit date after the facts
How to change your git commit date after the fact
[Read More]