How can I get multiple Jenkins builds to work from one local git repo?

前端 未结 4 2056
迷失自我
迷失自我 2020-12-13 18:52

I have a GitHub repo that\'s big and contains several independently build-able bits. If I configure Jenkins with a job (or two) for each of these, I end up with having to pu

4条回答
  •  感情败类
    2020-12-13 19:14

    1. Create a multi-configuration Jenkins job that just checks out your repo, and builds periodically. It doesn't have to build on every commit, since your other repos will automatically pull any changes from the actual remote if it doesn't find them in this repo.
    2. Open the "label" section of the configuration matrix, and check off each build node individually.
    3. On your other jobs, click on the Advanced button of the git SCM configuration, and find "Path of the reference repo to use during clone (optional)". Enter $WORKSPACE/../ReferenceRepo/label/$NODE_NAME, where ReferenceRepo is the name of the job you created above.

    You will need to re-clone each of your jobs on each machine for this to take effect. They should now use the data from the reference repo for everything they can, saving you disk space and bandwidth on your build nodes.

提交回复
热议问题