Jenkins- periodical poll and parametrized build











up vote
0
down vote

favorite












I currently have a job in jenkins that polls a git repository every 5 minutes and builds if there were any changes.



I wanted to add a parametrized build option, so that I can manually run a build for a specified commit hash.
My idea is that the job works as it does now (polls for changes and builds) plus allows me to trigger a manual build for a specific commit SHA (inputted by hand).



What's the best way to do this?










share|improve this question






















  • Have you tried it already? What is your experience, what errors or problems do occur?
    – triplem
    2 days ago










  • I had an idea to simply add a parameter to the job that contains the SHA and do a checkout before building. I'm not sure if it won't interfere with the poll building, that's what my question was actually about.
    – eilchner
    2 days ago










  • HEAD? or you could add a new step which determines if a commit id is given and uses a slightly different logic, as if it is not given?
    – triplem
    2 days ago










  • My idea was to add an additional Windows Batch step and run a checkout only if the parameter isn't empty and leave the rest of the building proces as it is
    – eilchner
    2 days ago










  • why a windows batch? like said, add a new step doing this. you could do this as a batch, but there is no real need for this.
    – triplem
    2 days ago















up vote
0
down vote

favorite












I currently have a job in jenkins that polls a git repository every 5 minutes and builds if there were any changes.



I wanted to add a parametrized build option, so that I can manually run a build for a specified commit hash.
My idea is that the job works as it does now (polls for changes and builds) plus allows me to trigger a manual build for a specific commit SHA (inputted by hand).



What's the best way to do this?










share|improve this question






















  • Have you tried it already? What is your experience, what errors or problems do occur?
    – triplem
    2 days ago










  • I had an idea to simply add a parameter to the job that contains the SHA and do a checkout before building. I'm not sure if it won't interfere with the poll building, that's what my question was actually about.
    – eilchner
    2 days ago










  • HEAD? or you could add a new step which determines if a commit id is given and uses a slightly different logic, as if it is not given?
    – triplem
    2 days ago










  • My idea was to add an additional Windows Batch step and run a checkout only if the parameter isn't empty and leave the rest of the building proces as it is
    – eilchner
    2 days ago










  • why a windows batch? like said, add a new step doing this. you could do this as a batch, but there is no real need for this.
    – triplem
    2 days ago













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I currently have a job in jenkins that polls a git repository every 5 minutes and builds if there were any changes.



I wanted to add a parametrized build option, so that I can manually run a build for a specified commit hash.
My idea is that the job works as it does now (polls for changes and builds) plus allows me to trigger a manual build for a specific commit SHA (inputted by hand).



What's the best way to do this?










share|improve this question













I currently have a job in jenkins that polls a git repository every 5 minutes and builds if there were any changes.



I wanted to add a parametrized build option, so that I can manually run a build for a specified commit hash.
My idea is that the job works as it does now (polls for changes and builds) plus allows me to trigger a manual build for a specific commit SHA (inputted by hand).



What's the best way to do this?







git jenkins






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 2 days ago









eilchner

28116




28116












  • Have you tried it already? What is your experience, what errors or problems do occur?
    – triplem
    2 days ago










  • I had an idea to simply add a parameter to the job that contains the SHA and do a checkout before building. I'm not sure if it won't interfere with the poll building, that's what my question was actually about.
    – eilchner
    2 days ago










  • HEAD? or you could add a new step which determines if a commit id is given and uses a slightly different logic, as if it is not given?
    – triplem
    2 days ago










  • My idea was to add an additional Windows Batch step and run a checkout only if the parameter isn't empty and leave the rest of the building proces as it is
    – eilchner
    2 days ago










  • why a windows batch? like said, add a new step doing this. you could do this as a batch, but there is no real need for this.
    – triplem
    2 days ago


















  • Have you tried it already? What is your experience, what errors or problems do occur?
    – triplem
    2 days ago










  • I had an idea to simply add a parameter to the job that contains the SHA and do a checkout before building. I'm not sure if it won't interfere with the poll building, that's what my question was actually about.
    – eilchner
    2 days ago










  • HEAD? or you could add a new step which determines if a commit id is given and uses a slightly different logic, as if it is not given?
    – triplem
    2 days ago










  • My idea was to add an additional Windows Batch step and run a checkout only if the parameter isn't empty and leave the rest of the building proces as it is
    – eilchner
    2 days ago










  • why a windows batch? like said, add a new step doing this. you could do this as a batch, but there is no real need for this.
    – triplem
    2 days ago
















Have you tried it already? What is your experience, what errors or problems do occur?
– triplem
2 days ago




Have you tried it already? What is your experience, what errors or problems do occur?
– triplem
2 days ago












I had an idea to simply add a parameter to the job that contains the SHA and do a checkout before building. I'm not sure if it won't interfere with the poll building, that's what my question was actually about.
– eilchner
2 days ago




I had an idea to simply add a parameter to the job that contains the SHA and do a checkout before building. I'm not sure if it won't interfere with the poll building, that's what my question was actually about.
– eilchner
2 days ago












HEAD? or you could add a new step which determines if a commit id is given and uses a slightly different logic, as if it is not given?
– triplem
2 days ago




HEAD? or you could add a new step which determines if a commit id is given and uses a slightly different logic, as if it is not given?
– triplem
2 days ago












My idea was to add an additional Windows Batch step and run a checkout only if the parameter isn't empty and leave the rest of the building proces as it is
– eilchner
2 days ago




My idea was to add an additional Windows Batch step and run a checkout only if the parameter isn't empty and leave the rest of the building proces as it is
– eilchner
2 days ago












why a windows batch? like said, add a new step doing this. you could do this as a batch, but there is no real need for this.
– triplem
2 days ago




why a windows batch? like said, add a new step doing this. you could do this as a batch, but there is no real need for this.
– triplem
2 days ago

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53373608%2fjenkins-periodical-poll-and-parametrized-build%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53373608%2fjenkins-periodical-poll-and-parametrized-build%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

MongoDB - Not Authorized To Execute Command

in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith

How to fix TextFormField cause rebuild widget in Flutter