forked from archiverjs/node-archiver
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
first attempt at automated docs build.
- Loading branch information
1 parent
1fcc8c3
commit 201ba0d
Showing
4 changed files
with
77 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
sudo: false | ||
language: node_js | ||
node_js: | ||
- "4.0" | ||
- "0.12" | ||
- "0.10" | ||
- '4.0' | ||
- '0.12' | ||
- '0.10' | ||
matrix: | ||
fast_finish: true | ||
fast_finish: true | ||
env: | ||
global: | ||
GH_REPO: github.com/archiverjs/website.git | ||
GH_REPO_BRANCH: master | ||
GH_REPO_DOCSDIR: docs | ||
secure: EKToLBZ66qitO7xrRmytgO0Rm53AVw3IevMtmRVvZ+8tCrwXUmkmGgY5E1aPa3fvtaZPZjtSQGOzSuJ0CR01Ktr70UzkC6YLhbw6IAEwU/AaHmQiHVBoJQTTxgZEk1Mku94M3m8IoZSVky98ShzfLU/cBJfmb3Lb7v4RgJGvTB0= | ||
after_success: | ||
- bash ./deploy.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
echo -n $TRAVIS_REPO_SLUG | ||
echo -n $TRAVIS_NODE_VERSION | ||
|
||
if [ "$TRAVIS_REPO_SLUG" != "archiverjs/node-archiver" ] || [ "$TRAVIS_PULL_REQUEST" == "true" ]; then | ||
exit 0 | ||
fi | ||
|
||
if [ "$TRAVIS_BRANCH" != "master" ] || [ "$TRAVIS_NODE_VERSION" != "4.0" ]; then | ||
exit 0 | ||
fi | ||
|
||
if [ -z "$GH_REPO" ] || [ -z "$GH_SECRET_TOKEN" ]; then | ||
echo "Missing required environment variables to run deploy." | ||
exit 1 | ||
fi | ||
|
||
if [ -z "$GH_USER_EMAIL" ]; then | ||
GH_USER_EMAIL = "[email protected]" | ||
fi | ||
|
||
if [ -z "$GH_USER_NAME" ]; then | ||
GH_USER_NAME = "travis-ci" | ||
fi | ||
|
||
if [ -z "$GH_REPO_BRANCH" ]; then | ||
GH_REPO_BRANCH = "master" | ||
fi | ||
|
||
if [ -z "$GH_REPO_DOCSDIR" ]; then | ||
GH_REPO_BRANCH = "docs" | ||
fi | ||
|
||
if [ -z "$GH_REPO_TMPNAME" ]; then | ||
GH_REPO_TMPNAME = "jsdoc-deploy" | ||
fi | ||
|
||
GH_REPO_TMPNAME_STAGED = "${GH_REPO_TMPNAME}-staging" | ||
|
||
echo -e "Running jsdoc...\n" | ||
npm run-script jsdoc | ||
cp -R tmp/jsdoc $HOME/${GH_REPO_TMPNAME_STAGED} | ||
|
||
echo -e "Publishing jsdoc...\n" | ||
|
||
cd $HOME | ||
|
||
git config --global user.email $GH_USER_EMAIL | ||
git config --global user.name $GH_USER_NAME | ||
git clone --quiet --branch=${GH_REPO_BRANCH} https://${GH_SECRET_TOKEN}@${GH_REPO} ${GH_REPO_TMPNAME} > /dev/null | ||
|
||
cd $GH_REPO_TMPNAME | ||
git rm -rf ./$GH_REPO_DOCSDIR | ||
cp -Rf $HOME/$GH_REPO_TMPNAME_STAGED ./$GH_REPO_DOCSDIR | ||
git status | ||
#git add -f . | ||
#git commit -m "deploy: latest jsdoc on successful travis build $TRAVIS_BUILD_NUMBER." | ||
#git push -fq origin $GH_REPO_BRANCH > /dev/null | ||
|
||
#echo -e "Published jsdoc.\n" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters