Skip to content
Lei Yang edited this page Aug 14, 2015 · 2 revisions

Install the requirements

Besides the standard library, the toolchain uses the following Python modules.

  • requests
  • libpagure
  • markdown

You may use pip to install the modules above.

Get the source code

git clone https://github.com/yangl1996/docs-toolchain.git
cd docs-toolchain

Modify config.py

There is a few settings to do before running the toolchain.

cp config_sample.py config.py
vim config.py
  • listenAddr: address at which the toolchain listens for webhook calls and HTTP requests
  • githubPort: port at which the toolchain listens for GitHub webhook calls
  • pagurePort: port at which the toolchain listens for Pagure webhook calls
  • localRepoPath: path to local git repository. This repository is used to sync new changes from GitHub to Pagure by doing git pull and then git push
  • patchFolderPath: path to the directory at which the toolchain stores patches of pull requests
  • issueDatabasePath: path to the sqlite3 database in which the toolchain holds information of each pull request and each doc file
  • githubSecretKey: the secret key GitHub uses to sign webhook payloads
  • githubToken: GitHub API access token. Be sure to keep it private and safe!
  • githubUsername: username of the owner of the GitHub repository
  • githubRepo: name of the GitHub repository
  • pagureSecretKey: the secret key Pagure uses to sign webhook payloads
  • pagureToken: Pagure API access token. Be sure to keep it private and safe!
  • pagureRepo: name of the Pagure repository
  • ciServer: URL (not the IP address or domain name) to the CI preview server
  • ciRepoPath: path to the directory at which the toolchain stores the built previews

Initialize the local git repository

  1. git clone the repository on GitHub
  2. add the git repository on Pagure as remote pagure
  3. git push to pagure to ensure the three repos are synced

CI Server

  1. create a folder at the path specified in config.ciRepoPath
  2. Start HTTP server on that folder

Initialize database

python3 database_init.py

Run the scripts

nohup python3 github.py &
nohup python3 pagure.py &

Clone this wiki locally