trying to cache Circle CI's checkout of ionic-site

This commit is contained in:
perry 2016-03-15 17:36:59 -05:00
parent 56fd46d9c3
commit 949c361026
5 changed files with 47 additions and 9 deletions

View File

@ -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."

33
scripts/docs/prepare.sh Executable file
View File

@ -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

View File

@ -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

View File

@ -23,4 +23,4 @@ function run {
cd ../
}
source $(dirname $0)/../utils.sh.inc
source $(dirname $0)/../utils.inc.sh