diff --git a/circle.yml b/circle.yml index d3a69c87..861353cb 100644 --- a/circle.yml +++ b/circle.yml @@ -8,7 +8,13 @@ general: branches: only: - master # ignore PRs and branches - + +dependencies: + pre: + - ./scripts/docs/prepare.sh + cache_directories: + - "~/ionic-site" # cache ionic-site + test: override: - echo "No tests are written at the moment. But we will attempt to build the library with the latest changes." diff --git a/scripts/docs/prepare.sh b/scripts/docs/prepare.sh new file mode 100755 index 00000000..5300127a --- /dev/null +++ b/scripts/docs/prepare.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +echo "##### " +echo "##### prepare.sh" +echo "#####" + + +function init { + cd .. + SITE_PATH=$(readJsonProp "config.json" "sitePath") + cd .. + export IONIC_DIR=$PWD + SITE_DIR=$IONIC_DIR/$SITE_PATH +} + +function run { + + if [ ! -d "$SITE_DIR" ]; then + echo "checking out" + cd ./scripts + ./git/clone.sh --repository="driftyco/ionic-site" \ + --directory="$SITE_DIR" \ + --branch="master" + ls -al $SITE_DIR + else + echo "using existing" + cd $SITE_DIR + git reset --hard + git pull origin master + fi +} + +source $(dirname $0)/../utils.inc.sh diff --git a/scripts/docs/update_docs.sh b/scripts/docs/update_docs.sh index 9ad1ab6c..b87868f9 100755 --- a/scripts/docs/update_docs.sh +++ b/scripts/docs/update_docs.sh @@ -14,12 +14,11 @@ function init { } function run { - ls -al - cd ./scripts - ./git/clone.sh --repository="driftyco/ionic-site" \ - --directory="$SITE_DIR" \ - --branch="master" - cd .. + + cd $SITE_DIR + git reset --hard + git pull origin master + VERSION=$(readJsonProp "package.json" "version") # process new docs @@ -45,4 +44,4 @@ function run { fi } -source $(dirname $0)/../utils.sh.inc +source $(dirname $0)/../utils.inc.sh diff --git a/scripts/git/clone.sh b/scripts/git/clone.sh index d44949c1..dd29fe56 100755 --- a/scripts/git/clone.sh +++ b/scripts/git/clone.sh @@ -23,4 +23,4 @@ function run { cd ../ } -source $(dirname $0)/../utils.sh.inc +source $(dirname $0)/../utils.inc.sh diff --git a/scripts/utils.sh.inc b/scripts/utils.inc.sh similarity index 100% rename from scripts/utils.sh.inc rename to scripts/utils.inc.sh