Skip to content
Alexander K edited this page Jun 6, 2022 · 3 revisions

trigger_build

Installation

As root:

adduser rtd
apt-get install python3-venv
su - rtd
git clone https://github.com/tempesta-tech/tempesta.wiki.git
cd tempesta.wiki
python3 -m venv venv
source venv/bin/activate
pip install -r scripts/requirements.txt

Usage

Usage: trigger_build [OPTIONS] RTD_TOKEN

  Instantly triggers ReadTheDocs build upon execution. Except for `rtd_token`
  value, it has meaningful defaults that just work.

  WARNING: please, use this responsibly and don't clog up the builds log.

Arguments:
  RTD_TOKEN  A token that you have to issue here
             https://readthedocs.org/accounts/tokens/  [required]

Options:
  -p, --rtd-project-slug TEXT     [default: tempesta-fw]
  -v, --rtd-version-slug TEXT     [default: latest]
  -r, --repo-path TEXT            [default: .]
  -b, --gh-ref TEXT               [default: master]
  -y, --confirmed                 Don't ask for confirmation.
  -d, --dispatch                  This option enables dispatching mode. It
                                  will be continuously fetching the repository
                                  and cause rebuilding of the docs on new
                                  commits.
  -i, --dispatch-interval INTEGER
                                  The interval between repository fetching
                                  events in dispatching mode.  [default: 600]
  --help                          Show this message and exit.

Systemd

There's a unit file that you have to copy to your /etc/systemd/system/. After that do:

systemctl edit trigger_rtd_build

You will be prompted to edit a file, add [Service] line and add an environment variable with RTD_TOKEN (you can get the token at https://readthedocs.org/accounts/tokens/):

[Service]
Environment="RTD_TOKEN=your_token_value"

Now you're ready to go:

systemctl start trigger_rtd_build

The logs of this service can be accessed as follows:

journalctl -u trigger_rtd_build
Clone this wiki locally