forked from blackbaud/skyux1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update-skyux-docs.sh
34 lines (25 loc) · 1.09 KB
/
update-skyux-docs.sh
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
# Fail the build if this step fails
set -e
# Only run for a release
if [[ "$IS_RELEASE" == "true" && "$IS_PRERELEASE" == "false" ]]; then
echo -e "Starting to update sky docs\n"
# This is normally master
branch="master"
# What user will be committing to the sky-docs repo
git config --global user.email "travis@travis-ci.org"
git config --global user.name "Travis"
# Clones the sky-docs repo into a "docs/" folder
git clone --quiet --branch=$branch https://${GH_TOKEN}@github.com/blackbaud/skyux-docs.git docs > /dev/null
# Copy jsdoc output
cp -f demo/data/sky.json docs/sky-jsdoc/sky-$RELEASE_VERSION.json
# Updating this file will cause the documentation to be updated
echo "$RELEASE_VERSION" > docs/includes/latest-release.txt
# Create a timestamp file for stache to read
echo "`date -u`" > docs/includes/timestamp.txt
# Commit and push all our changes to the repo
cd docs
git add -f .
git commit -m "Travis build $TRAVIS_BUILD_NUMBER pushed $RELEASE_VERSION to skyux-docs"
git push -fq origin $branch > /dev/null
echo -e "Sky Docs successfully updated.\n"
fi