Reputation:
I'm trying to find a way to build every exists commits when adding new project to my jenkins. For example: I already created a project here Some of my users request me to build old versions(commits) so they can use them,it's imposslble for me to checkout every commit and perform a manually build. I want to build every old commits here automatically when I add this project to my jenkins. Is there anyway to do that?Deleting and re-createing the jenkins project is acceptable.
PS:Tried to search on Google,but it seems that there's nobody have such a demand...(or I just typed wrong keywords?)
Upvotes: 2
Views: 606
Reputation: 1324757
You need first to script that process: once it is scripted, you can call that same script from Jenkins.
The script would need to list all commits, and determine if there is a build or not. Typically, you would leave a marker on the commit to indicate that a build was performed: a tag, or (more discrete) a git notes
That way, you can run/interrupt/restart that script as many time as you want: for any commit it detects there is no build, it can trigger one (git checkout + build
)
Executed in context of a Jenkins job, the git checkout would set the working tree to the right commit, launch a build, publish its result (the binary artifact) somewhere, then tag or annotate the commit.
Upvotes: 1