mirror of
https://github.com/nasa/openmct.git
synced 2025-04-09 04:14:32 +00:00
[Continous] Build and publish documentation
This commit is contained in:
parent
cb56bbe569
commit
808a79178b
42
build-docs.sh
Executable file
42
build-docs.sh
Executable file
@ -0,0 +1,42 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Script to build and deploy docs to github pages.
|
||||
|
||||
# Any Content currently visible on the website will be replaced by
|
||||
# this process.
|
||||
|
||||
OUTPUT_DIRECTORY="docs"
|
||||
REPOSITORY_URL="git@github.com:larkin/openmctweb.git"
|
||||
|
||||
BUILD_SHA=`git rev-parse head`
|
||||
|
||||
# A remote will be created for the git repository we are pushing to.
|
||||
# Don't change the name.
|
||||
REMOTE_NAME="documentation"
|
||||
WEBSITE_BRANCH="gh-pages"
|
||||
|
||||
# Configure github for CircleCI user.
|
||||
git config --global user.email "buildbot@circleci.com"
|
||||
git config --global user.name "BuildBot"
|
||||
|
||||
# clean output directory
|
||||
if [ -d $OUTPUT_DIRECTORY ]; then
|
||||
rm -rf $OUTPUT_DIRECTORY || exit 1
|
||||
fi
|
||||
|
||||
npm run-script jsdoc
|
||||
cd $OUTPUT_DIRECTORY || exit 1
|
||||
|
||||
echo "git init"
|
||||
git init
|
||||
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 gh-pages branch."
|
5
circle.yml
Normal file
5
circle.yml
Normal file
@ -0,0 +1,5 @@
|
||||
deployment:
|
||||
production:
|
||||
branch: continuous-deployment
|
||||
commands:
|
||||
- ./build-docs.sh
|
Loading…
x
Reference in New Issue
Block a user