#234 CI/CD: add C3I jobs to poll for master branch and PRs on Pagure
Merged by csomh. Opened by rayson.
rayson/waiverdb cicd-polling-pagure  into  master

Download 234.patch

Two Jenkins jobs are added to poll for master branch changes and new PRs
on Pagure.

As a temporary solution for triggering pipeline builds automatically
when changes on master branch or pull-requests, polling is used before
we eventually move to UMB-WebHook triggers.

The 2 polling jobs are needed because

  1. to keep the logic of polling separated with dev-pipeline job, which
    could be triggered by UMB-WebHook eventually.
  2. Currently Jenkins requires a persist workspace to poll for wildcard branch names.
    dev-pipeline job runs Jenkins slaves as pods, which are discarded after
    job runs.
  3. We need to run dev-pipline for both pre-merge and post-merge
    workflows. Polling for PRs and the master branch in a single Jenkins job
    will NOT trigger a master branch build when a fast-forward merge happens to a PR.

We can't move the Jenkinsfile to an external file otherwise Jenkins will
also poll for the branch where Jenkins file is referenced.

The polling is run on Jenkins master. Demo jobs:
https://paas.upshift.redhat.com/console/project/waiverdb-test/browse/pipelines/stage-waiverdb-polling-for-master
https://paas.upshift.redhat.com/console/project/waiverdb-test/browse/pipelines/stage-waiverdb-polling-for-prs

rebased onto 9148bcea1b6a372ac6bcd5fa94fa6fe3369e31a5

Wondering if these tmpl files could be replaced by symlinks...

If the branch can be changed, than maybe this should be called PAGURE_POLLED_BRANCH (remove MASTER from the name).

@csomh Thanks for the review. I've changed the parameter name to PAGURE_POLLED_BRANCH.
For the .tmpl files, symlinks are not used because the directory can be overridden if running with make TEMPLATES_DIR=somedir (also for pipeline development/test purpose)

rebased onto 2b5eb88319e1772e5989747ded375035a76adad5

Are these env variables needed? Is it possible to use the template variables directly in the Jenkinsfile?

@lholecek Yes. Because an external Jenkinsfile is not used, we can directly use those template variables.

rebased onto 2ab60b6cb2bfe6c23ce442ccc8ef628a2ac26609

Commit ea76fdc0 fixes this pull-request

Pull-Request has been merged by csomh

Pull-Request has been merged by csomh

Metadata