From 809a9b5204804ef36bae56f04eb640ab342fd381 Mon Sep 17 00:00:00 2001 From: Dave Cole Date: Tue, 9 Apr 2013 18:26:13 -0400 Subject: Reorganize app to use external scripts. Make main file executable. Move sample code to readme. Refs #40. --- scripts/build.sh | 25 +++++++++++++++++++++++++ scripts/publish.sh | 16 ++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100755 scripts/build.sh create mode 100755 scripts/publish.sh (limited to 'scripts') diff --git a/scripts/build.sh b/scripts/build.sh new file mode 100755 index 0000000..c4942ac --- /dev/null +++ b/scripts/build.sh @@ -0,0 +1,25 @@ +#!/bin/bash +set -e + +repo=$1 +branch=$2 +owner=$3 +giturl=$4 +source=$5 +build=$6 + +# Check to see if repo exists. If not, git clone it +if [ ! -d $source ]; then + git clone $giturl $source +fi + +# Git checkout appropriate branch, pull latest code +cd $source +git checkout $branch +git pull origin $branch +cd - + +# Run jekyll +cd $source +jekyll $source $build --no-server --no-auto -base-url="/$repo" +cd - diff --git a/scripts/publish.sh b/scripts/publish.sh new file mode 100755 index 0000000..5e1d2f1 --- /dev/null +++ b/scripts/publish.sh @@ -0,0 +1,16 @@ +#!/bin/bash +set -e + +repo=$1 +branch=$2 +owner=$3 +giturl=$4 +source=$5 +build=$6 + +# Set the path of the hosted site +site="/usr/share/nginx/www/$repo" + +# Remove old site files, move new ones in place +rm -rf $site +mv $build $site -- cgit v1.2.3