Builder for *Ghaf *project [https://github.com/tiiuae/ghaf](URL) Github Pull Requests
Uses Ghaf build tools from https://github.com/tiiuae/ci-public (assumes usage of Ghaf docker based Hydra build system implementation)
Activates Hydra to build new open Pull Requests (for the main repo under observations) or allready built open PRs with new changes
Can be used in service mode (polling frequently repo changes) or cherry picking one open PR for building or just running once here and then
Keeps internal records for build PRs and rebuild changed PRs (building means commanding Hydra to initiate build for given PR branch and getting "ok" from Hydra)
##USAGE
- Setup Ghaf Hydra build system (tools&docs in https://github.com/tiiuae/ci-public)
2) Set Hydra env variables HYDRACTL_USERNAME="hydra" and HYDRACTL_PASSWORD="zzzzz"
3) Create tokenfile to include your access token to Ghaf repo
4) Start (one off run) poller execution: python3 PollPr.py (use docker host , tools repo in the host)
Editing "build" information files, one can manipulate which PR number is thought to be build or not
##CONFIGURATIONS (in PollPR.py)
TOKENFILE="tokenfile" # Includes token to access Github repo for these PR observations
TESTREPO='mnokka-unikie/ghaf' # Ghaf repo under PR observations
ORGANIZATION="tiiuae" # required Github organization membership before building PR proceeds
BUILDPRSFILE="pr2_data" # local file to store handled (built) PRs by their Github ID
BUILDCHANGEDPRSFILE="pr2_changed_data" # local file to store builds done for open (but build initially) and changed PRs
HYDRACTL="./hydractl.py" # CLI command location (Ghaf inhouse public tool) to manage Hydra operations
EXT_PORT=3030 # Hybdra port dedicated for the build server (docker will expose this to the host)
**RUNDELAY=1 **# minutes to wait before next execution of this script (in service mode
usage: PollPR.py [-h] [-v] [-d dry] [-t verbose] [-s service] [-p cherrypick]
Github PullRequest Hydra builder activator
options:
-h, --help show this help message and exit
-v Check Github open PRs and activate Ghaf Hydra build
-d dry Dry run mode
-t verbose Verbose, talking, mode
-s service Service mode, runtime delays in secs
-p cherrypick Cherry pick PR number, ignore others
PollPR.py --> run once
PollPr.py -d on --> run once drymode, do not do any changes
PollPr.py -p 42 --> Ask Hydra to build PR42
PollPr.py -s 60 --> run every hour