awesome-cordova-plugins/scripts/docs/update_docs.sh

44 lines
1023 B
Bash
Raw Normal View History

#!/bin/bash
echo "##### "
echo "##### ci/deploy.sh"
echo "#####"
function init {
cd ..
SITE_PATH=$(readJsonProp "config.json" "sitePath")
cd ..
export IONIC_DIR=$PWD
SITE_DIR=$IONIC_DIR/$SITE_PATH
}
function run {
VERSION=$(readJsonProp "package.json" "version")
# process new docs
2016-03-16 06:43:59 +08:00
./node_modules/.bin/gulp docs
# CD in to the site dir to commit updated docs
cd $SITE_DIR
CHANGES=$(git status --porcelain)
# if no changes, don't commit
if [[ "$CHANGES" == "" ]]; then
echo "-- No changes detected for the following commit, docs not updated."
echo "https://github.com/driftyco/$CIRCLE_PROJECT_REPONAME/commit/$CIRCLE_SHA1"
else
2016-01-26 11:54:26 +08:00
git config --global user.email "hi@ionicframework.com"
git config --global user.name "Ionitron"
git add -A
git commit -am "Automated build of platform docs driftyco/$CIRCLE_PROJECT_REPONAME@$CIRCLE_SHA1"
git push origin master
echo "-- Updated docs for $VERSION_NAME succesfully!"
fi
}
source $(dirname $0)/../utils.inc.sh