From 687faabb073ab0755d01d22ead8717aba7fc6974 Mon Sep 17 00:00:00 2001 From: Aleksey Burov Date: Mon, 3 Dec 2018 10:30:01 +0700 Subject: [PATCH] Add github --- docs/contribution.rst | 26 ++++++++++++++++++++++++++ docs/index.rst | 1 + docs/publish-gh-pages.sh | 30 ++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 docs/publish-gh-pages.sh diff --git a/docs/contribution.rst b/docs/contribution.rst index d0fdb59..6523ab5 100644 --- a/docs/contribution.rst +++ b/docs/contribution.rst @@ -16,6 +16,32 @@ Development takes place on GitHub, where the git-flow branch structure is used: * ``feature/XXX`` - feature branches are used for development of new features before they are merged to ``develop`` +Documentation +=========== + +We use sphinx to build docs:: + + cd docs-sphinx + make html + # open ./docs/_build/html/index.html on your browser + start ./_build/html/index.html # Windows + + +Publish +~~~~~~~~~~~~~~ + +For repositories admin: + + + All documentation saved in ``docs``-folder on branches. + + We use ``gh-pages`` as source for publishing on github pages. + + Read example how it work on `habr.com (Russian) `__ + +Run this script to publish new html on https://devopshq.github.io/tfs/ :: + + cd docs + bash ./publish-gh-pages.sh + + Tests ===== diff --git a/docs/index.rst b/docs/index.rst index 6505847..41858c4 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -12,6 +12,7 @@ Microsoft TFS Python Library (TFS API Python client) others contribution api + GitHub Introduction ************ diff --git a/docs/publish-gh-pages.sh b/docs/publish-gh-pages.sh new file mode 100644 index 0000000..8ee3595 --- /dev/null +++ b/docs/publish-gh-pages.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +set -e +shopt -s extglob dotglob + + +CURR_DIR="$(pwd)" +TMP_DIR=$(mktemp -d) + +# build +make clean +make html + +# push to branch gh-pages +cd $TMP_DIR +echo "Use temp directory: $TMP_DIR" +git clone git@github.com:devopshq/tfs.git +cd tfs +git branch -D gh-pages || echo "branch don't exist" +git checkout --orphan gh-pages +rm -rf !(.git|.gitignore) | echo "something wrong, but contiunue" + +cp -r $CURR_DIR/_build/html/* . + +git add -A +git commit -m "published" +git push origin :gh-pages +git push origin gh-pages + +cd $CURR_DIR +rm -rf "$TMP_DIR"