Single jenkins job for all repositories in a Github organization

后端 未结 5 924
轻奢々
轻奢々 2021-01-15 01:23

We own a Github organization with hundreds repositories that are authored by contributors. We would like to setup a Jenkins server that performs certain standard tasks for e

5条回答
  •  抹茶落季
    2021-01-15 01:57

    The standard approach would be to create a new multibranch pipeline which scans your organization for new repositories. Every repository should have a jenkinsfile with the instructions to build. But in general it is also possible to achieve what you are trying on a programmatical way.

    What my approach would be:

    1. Create a Job Template as config.xml (shell script to run docker to check certain things)
    2. Scan GitHub to find new Repositories
    3. Create a new jenkins job based on the temnplate (ideally just replace the SCM link to the new location) How-to-create-a-job-using-the-REST-API-and-cURL
    4. Run that job

    I would use the Folders Plugin to create a folder for this type of jobs.

    If that is what you are really trying to do I could elaborate further.

提交回复
热议问题