2016-03-16 06:36:59 +08:00
|
|
|
#!/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 {
|
2016-05-05 06:03:53 +08:00
|
|
|
# no need to run on PRs
|
|
|
|
if [ -z $CI_PULL_REQUEST ] then
|
|
|
|
exit 0
|
|
|
|
fi
|
2016-03-16 06:36:59 +08:00
|
|
|
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
|