Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
DOCS_OUTPUT_DIR ?= generated/docs
DOCS_PUBLISH_DIR ?= ../envoy-docs

.PHONY: docs
docs:
rm -fr generated/docs
mkdir -p generated/docs
docs/build.sh $(DOCS_OUTPUT_DIR)

.PHONY: publish_docs
publish_docs: docs
docs/publish.sh $(DOCS_OUTPUT_DIR) $(DOCS_PUBLISH_DIR)

2 changes: 2 additions & 0 deletions ci/do_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ echo "building using $NUM_CPUS CPUs"
if [[ "$1" == "docs" ]]; then
echo "docs build..."
make docs
# this target will run a script that will publish docs on a master commit.
docs/publish.sh
exit 0
fi

Expand Down
28 changes: 14 additions & 14 deletions docs/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

set -e

DOCS_DIR=$1
PUBLISH_DIR=$2
DOCS_DIR=generated/docs
PUBLISH_DIR=../envoy-docs
BUILD_SHA=`git rev-parse HEAD`

if [[ ! -d $PUBLISH_DIR ]]; then
echo "$PUBLISH_DIR does not exist. Clone a fresh envoy repo."
if [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ]
then
git clone https://GH_TOKEN@github.com/lyft/envoy $PUBLISH_DIR
git -C $PUBLISH_DIR config user.name "Publish Docs"
git -C $PUBLISH_DIR config user.email GH_EMAIL
git -C $PUBLISH_DIR fetch
git -C $PUBLISH_DIR checkout -B gh-pages origin/gh-pages
rm -fr $PUBLISH_DIR/*
cp -r $DOCS_DIR/* $PUBLISH_DIR
git -C $PUBLISH_DIR add .
git -C $PUBLISH_DIR commit -m "docs @$BUILD_SHA"
git -C $PUBLISH_DIR push origin gh-pages
fi

git -C $PUBLISH_DIR fetch
git -C $PUBLISH_DIR checkout -B gh-pages origin/gh-pages
rm -fr $PUBLISH_DIR/*
cp -r $DOCS_DIR/* $PUBLISH_DIR
git -C $PUBLISH_DIR add .
git -C $PUBLISH_DIR commit -m "docs @$BUILD_SHA"

echo
echo "*** YOU MUST MANUALLY PUSH the gh-pages branch after verifying the commit ***"