eni23 / gitlab-docsbot

The Docs Bot - A simple service which receives HTTP build triggers from GitLab and unpacks built artifacts inside a configured directory.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GitLab CI Docs Bot

Travis License

This script starts a simple web server which accepts requests from GitLab webhooks and downloads artifacts from the latest build to a defined directory.

Installation

# apt-get install python-setuptools python-pip python-yaml
# python setup.py install
# systemctl daemon-reload
# systemctl enable gitlab-autodocs.service
# systemctl start gitlab-autodocs.service

Configuration

Initial

Add a new user in GitLab called docs-bot and get his API-Key. Then edit /etc/gitlab-autodocs.yaml and set your GitLab URL and the API key.

Add new repos to sync

You need to create a .docs-bot.yml in your repository, example:

docs:
  extract_to: /var/www/docs/autodocs-ci-test
  download_delay: 10
  stages:
    - docs

docs needs to be the root entry of .docs-bot.yml

  • extract_to directory to put artifacts
  • download_delay since GitLab triggers before uploading artifacts, you can configure a delay before fetching them
  • stages if defined, only sync specified build stages configured in .gitlab-ci.yml

In GitLab, you need to grant docs-bot access to your repo and add a new webhook which triggers on build events, pointing to your docsync URL.

Contributions

Contributions are more than welcome! Please feel free to open new issues or pull requests.

License

GNU GENERAL PUBLIC LICENSE Version 3

See the LICENSE file.

About

The Docs Bot - A simple service which receives HTTP build triggers from GitLab and unpacks built artifacts inside a configured directory.

License:GNU General Public License v3.0


Languages

Language:Python 98.8%Language:Makefile 1.2%