forked from ionic-team/ionic-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocs.sh
More file actions
executable file
·47 lines (34 loc) · 1.03 KB
/
docs.sh
File metadata and controls
executable file
·47 lines (34 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
ARG_DEFS=(
"--version-name=(.*)"
)
echo "##### "
echo "##### site/docs.sh"
echo "#####"
function init {
SITE_DIR=$HOME/ionic-site
}
# Example: ./scripts/site/publish.sh --action=docs --version-name=nightly
function run {
cd ../..
VERSION=$(readJsonProp "package.json" "version")
node_modules/.bin/gulp docs --doc-version="$VERSION_NAME" --dist=$SITE_DIR
node_modules/.bin/gulp docs-index --dist=$SITE_DIR
cd $SITE_DIR
#npm install
CHANGES=$(git status --porcelain)
# if no changes, don't commit
if [[ "$CHANGES" == "" ]]; then
echo "-- No changes detected in docs for $VERSION_NAME; docs not updated."
else
git add -A
git commit -am "Automated build of native docs driftyco/$CIRCLE_PROJECT_REPONAME@$CIRCLE_SHA1"
# in case a different commit was pushed to ionic-site during doc/demo gen,
# try to rebase around it before pushing
git fetch
git rebase
git push origin master
echo "-- Updated docs for $VERSION_NAME succesfully!"
fi
}
source $(dirname $0)/../utils.inc