diff options
author | Dave Cole <dave@developmentseed.org> | 2013-04-09 18:26:13 -0400 |
---|---|---|
committer | Dave Cole <dave@developmentseed.org> | 2013-04-09 18:26:13 -0400 |
commit | 809a9b5204804ef36bae56f04eb640ab342fd381 (patch) | |
tree | a9a20765f2c84a1027a01a6713395bfb54ed6a8e /scripts | |
parent | e28985afe274e46086f73d20ac6cebc7710204d4 (diff) |
Reorganize app to use external scripts. Make main file executable. Move sample code to readme. Refs #40.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/build.sh | 25 | ||||
-rwxr-xr-x | scripts/publish.sh | 16 |
2 files changed, 41 insertions, 0 deletions
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 |