[Website] Automate site build process

This commit is contained in:
Henry 2016-05-18 16:59:23 -07:00
parent 5b4952d4c6
commit bcdd835275
2 changed files with 19 additions and 14 deletions

View File

@ -25,14 +25,15 @@
# Script to build and deploy docs to github pages.
OUTPUT_DIRECTORY="target/docs"
REPOSITORY_URL="git@github.com:nasa/openmctweb.git"
REPOSITORY_URL="git@github.com:nasa/openmct-website.git"
WEBSITE_DIRECTORY="website"
BUILD_SHA=`git rev-parse head`
# A remote will be created for the git repository we are pushing to.
# Don't worry, as this entire directory will get trashed inbetween builds.
REMOTE_NAME="documentation"
WEBSITE_BRANCH="gh-pages"
WEBSITE_BRANCH="master"
# Clean output directory, JSDOC will recreate
if [ -d $OUTPUT_DIRECTORY ]; then
@ -40,23 +41,21 @@ if [ -d $OUTPUT_DIRECTORY ]; then
fi
npm run docs
cd $OUTPUT_DIRECTORY || exit 1
echo "git init"
git init
echo "git clone $REPOSITORY_URL website"
git clone $REPOSITORY_URL website
echo "cp -r $OUTPUT_DIRECTORY $WEBSITE_DIRECTORY/docs"
cp -r $OUTPUT_DIRECTORY $WEBSITE_DIRECTORY/docs
echo "cd $WEBSITE_DIRECTORY"
cd $WEBSITE_DIRECTORY
# Configure github for CircleCI user.
git config user.email "buildbot@circleci.com"
git config user.name "BuildBot"
echo "git remote add $REMOTE_NAME $REPOSITORY_URL"
git remote add $REMOTE_NAME $REPOSITORY_URL
echo "git add ."
git add .
echo "git commit -m \"Generate docs from build $BUILD_SHA\""
git commit -m "Generate docs from build $BUILD_SHA"
echo "git push $REMOTE_NAME HEAD:$WEBSITE_BRANCH -f"
git push $REMOTE_NAME HEAD:$WEBSITE_BRANCH -f
echo "Documentation pushed to gh-pages branch."
echo "git commit -m \"Docs updated from build build $BUILD_SHA\""
git commit -m "Docs updated from build build $BUILD_SHA"
echo "git push"
git push

View File

@ -3,6 +3,12 @@ deployment:
branch: master
heroku:
appname: openmctweb-demo
website:
branch: openmct-website
commands:
- git clone
- git push git@heroku.com:openmctweb-demo.git $CIRCLE_SHA1:refs/heads/master
openmct-demo:
branch: live_demo
heroku: