This repository has been archived by the owner on Aug 4, 2019. It is now read-only.
-
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.
Configuring travis to upload wikies on gh-pages branch, #51
- Loading branch information
Showing
4 changed files
with
21 additions
and
27 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,29 +5,21 @@ set -e # Exit with nonzero exit code if anything fails | |
# Save some useful information | ||
REPO_URL=`git config remote.origin.url` | ||
SHA=`git rev-parse --verify HEAD` | ||
|
||
# Get the deploy key by using Travis's stored variables to decrypt deploy_key.enc | ||
ENCRYPTED_KEY_VAR="encrypted_${ENCRYPTION_LABEL}_key" | ||
ENCRYPTED_IV_VAR="encrypted_${ENCRYPTION_LABEL}_iv" | ||
ENCRYPTED_KEY=${!ENCRYPTED_KEY_VAR} | ||
ENCRYPTED_IV=${!ENCRYPTED_IV_VAR} | ||
OUT_KEY="travis-github-wiki-rsa" | ||
openssl aes-256-cbc -K $ENCRYPTED_KEY -iv $ENCRYPTED_IV -in "${OUT_KEY}.enc" -out "$OUT_KEY" -d | ||
chmod 600 $OUT_KEY | ||
eval `ssh-agent -s` | ||
ssh-add $OUT_KEY | ||
|
||
|
||
# Clone/checkout the wiki branch from Github alongside the master branch working copy directory : | ||
rm -rf ../project-wiki | ||
git -C .. clone [email protected]:Carrene/wolf.wiki.git project-wiki | ||
GIT="git -C ../project-wiki" | ||
$GIT pull origin master | ||
$GIT rm \*.md | ||
cp data/api-documents/api/*.md ../project-wiki/ | ||
$GIT add \*.md | ||
VERSION=`grep -P '^__version__ =' wolf/__init__.py | grep -oP \ | ||
'([1-9]\d*!)?(0|[1-9]\d*)(\.(0|[1-9]\d*))*((a|b|rc)(0|[1-9]\d*))?(\.post(0|[1-9]\d*))?(\.dev(0|[1-9]\d*))?'` | ||
VERSION="v${VERSION}" | ||
TARGET="../project-gh-pages/$VERSION" | ||
# Clone/checkout the gh-pages branch from Github alongside the master branch working copy | ||
# directory: | ||
rm -rf ../project-gh-pages | ||
git -C .. clone [email protected]:Carrene/wolf.git -b gh-pages project-gh-pages | ||
GIT="git -C ../project-gh-pages" | ||
$GIT rm $VERSION/\*.md | ||
mkdir -p $TARGET | ||
cp data/documentation/*.md $TARGET | ||
$GIT add $VERSION/\*.md | ||
$GIT config user.name "Travis CI" | ||
$GIT config user.email "$COMMIT_AUTHOR_EMAIL" | ||
$GIT commit -am "Deploy to GitHub WIKI: ${SHA}" | ||
$GIT push origin master | ||
$GIT commit -am "Deploy to Github Pages: ${VERSION} ${SHA}" | ||
$GIT push origin gh-pages | ||
|
Binary file not shown.