pollux.codes

Files for the pollux.codes site
git clone git://pollux.codes/git/pollux.codes.git
Log | Files | Refs

deploy.sh (525B)


      1 #!/bin/sh
      2 
      3 if [ ! -f hugo.toml ]; then
      4 	echo "Must be run in hugo base directory... Exiting."
      5 	exit 1
      6 fi
      7 
      8 if [ "$(git status --porcelain | wc -l)" -gt 0 ]; then
      9 	echo "There are uncommited changes... Exiting."
     10 	exit 1
     11 fi
     12 
     13 if [ "$(git rev-parse --abbrev-ref HEAD)" != "master" ]; then
     14 	echo "Not on branch master... Exiting."
     15 	exit 1
     16 fi
     17 
     18 if [ -d public/ ]; then
     19 	echo "Cleaning old build."
     20 	rm -r public/
     21 fi
     22 
     23 echo "Deploying site..."
     24 hugo && rsync -avz --delete --exclude=git/ public/ www@pollux.codes:/srv/html/pollux.codes/