-
Notifications
You must be signed in to change notification settings - Fork 712
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1517 from weaveworks/docs-automation
Circle integration for auto docs publishing.
- Loading branch information
Showing
4 changed files
with
85 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
set -o pipefail | ||
|
||
: ${PRODUCT:=} | ||
|
||
fatal() { | ||
echo "$@" >&2 | ||
exit 1 | ||
} | ||
|
||
if [ ! -d .git ] ; then | ||
fatal "Current directory is not a git clone" | ||
fi | ||
|
||
if [ -z "${PRODUCT}" ]; then | ||
fatal "Must specify PRODUCT" | ||
fi | ||
|
||
if ! BRANCH=$(git symbolic-ref --short HEAD) || [ -z "$BRANCH" ] ; then | ||
fatal "Could not determine branch" | ||
fi | ||
|
||
case "$BRANCH" in | ||
issues/*) | ||
VERSION="${BRANCH#issues/}" | ||
TAGS="$VERSION" | ||
;; | ||
*) | ||
if echo "$BRANCH" | grep -qE '^[0-9]+\.[0-9]+' ; then | ||
DESCRIBE=$(git describe --match 'v*') | ||
if ! VERSION=$(echo "$DESCRIBE" | grep -oP '(?<=^v)[0-9]+\.[0-9]+\.[0-9]+') ; then | ||
fatal "Could not infer latest $BRANCH version from $DESCRIBE" | ||
fi | ||
TAGS="$VERSION latest" | ||
else | ||
VERSION="$BRANCH" | ||
TAGS="$VERSION" | ||
fi | ||
;; | ||
esac | ||
|
||
for TAG in $TAGS ; do | ||
echo ">>> Publishing $PRODUCT $VERSION to $1/docs/$PRODUCT/$TAG" | ||
wordepress \ | ||
--url "$1" --user "$2" --password "$3" \ | ||
--product "$PRODUCT" --version "$VERSION" --tag "$TAG" \ | ||
publish site | ||
done |
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 |
---|---|---|
|
@@ -11,3 +11,5 @@ handlers: | |
libraries: | ||
- name: webapp2 | ||
version: latest | ||
- name: ssl | ||
version: latest |
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