This script starts a simple web server which accepts requests from GitLab webhooks and downloads artifacts from the latest build to a defined directory.
# 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
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.
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 artifactsdownload_delay
since GitLab triggers before uploading artifacts, you can configure a delay before fetching themstages
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 are more than welcome! Please feel free to open new issues or pull requests.
GNU GENERAL PUBLIC LICENSE Version 3
See the LICENSE file.