Skip to content

Commit

Permalink
Add github
Browse files Browse the repository at this point in the history
  • Loading branch information
allburov committed Dec 3, 2018
1 parent d848ce6 commit 687faab
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
26 changes: 26 additions & 0 deletions docs/contribution.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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) <https://habr.com/post/180213/>`__

Run this script to publish new html on https://devopshq.github.io/tfs/ ::

cd docs
bash ./publish-gh-pages.sh


Tests
=====

Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Microsoft TFS Python Library (TFS API Python client)
others
contribution
api
GitHub <https://github.com/devopshq/tfs>

Introduction
************
Expand Down
30 changes: 30 additions & 0 deletions docs/publish-gh-pages.sh
Original file line number Diff line number Diff line change
@@ -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 [email protected]: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"

0 comments on commit 687faab

Please sign in to comment.