Excluding .yaml and .md files from auto triggering the Jenkins build
I do not want the Jenkins build to auto trigger when .yaml files and readme files are changed and committed. I am looking for a global function that I can call in my Jenkinsfile.
Any suggestions are appreciated.
Thanks!
jenkins jenkins-pipeline
add a comment |
I do not want the Jenkins build to auto trigger when .yaml files and readme files are changed and committed. I am looking for a global function that I can call in my Jenkinsfile.
Any suggestions are appreciated.
Thanks!
jenkins jenkins-pipeline
add a comment |
I do not want the Jenkins build to auto trigger when .yaml files and readme files are changed and committed. I am looking for a global function that I can call in my Jenkinsfile.
Any suggestions are appreciated.
Thanks!
jenkins jenkins-pipeline
I do not want the Jenkins build to auto trigger when .yaml files and readme files are changed and committed. I am looking for a global function that I can call in my Jenkinsfile.
Any suggestions are appreciated.
Thanks!
jenkins jenkins-pipeline
jenkins jenkins-pipeline
edited Dec 31 '18 at 19:45
StephenKing
20.6k54981
20.6k54981
asked Dec 29 '18 at 0:12
user3194721user3194721
2223829
2223829
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
In your job's configuration under the Build Triggers section, you should be able to find what you are looking for (usually under the Advanced tab). For example, on my instance of Jenkins, for the "GitHub Pull Request Builder" trigger type, after clicking the Advanced button, you can see an "Excluded regions" textbox with the following help description:
Each exclusion uses regular expression pattern matching, and must be separated by a new line.
myapp/src/main/web/.*.html
myapp/src/main/web/.*.jpeg
myapp/src/main/web/.*.gif
The example above illustrates that if only html/jpeg/gif files have been committed to the GitHub repository a build will not occur.
More information on regular expressions can be found here.
Other trigger types will have something similar to the notion of "Excluded regions".
Moreover, Jenkins has added functionality like this in various ways as discussed in resolved Jira tickets such as JENKINS-21418 and JENKINS-36614.
I hope that helps. I know that it isn't a global function in a Jenkins file, as per the question, but I think that it can be a viable solution to the problem in general.
add a comment |
Jenkins declarative language checkout presumably also cover excludedRegions which is the same option @entpnerd described in the GitHub Pull Request Builder plugin:
excludedRegions
If set, and Jenkins is set to poll for changes, Jenkins will ignore
any files and/or folders in this list when determining if a build
needs to be triggered.
See a Jenkinsfile example in a similar stackoverflow question. Jira issue JENKINS-36195 requested for this functionality and JENKINS-36836 provided working and not working cases and why.
The reality is that it is not working and it is not planned to be included:
There have been some brief discussions about it, but there are no
plans to address it
so I would go for Jenkins GUI polling configuration.
add a comment |
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',
autoActivateHeartbeat: false,
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53965624%2fexcluding-yaml-and-md-files-from-auto-triggering-the-jenkins-build%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
In your job's configuration under the Build Triggers section, you should be able to find what you are looking for (usually under the Advanced tab). For example, on my instance of Jenkins, for the "GitHub Pull Request Builder" trigger type, after clicking the Advanced button, you can see an "Excluded regions" textbox with the following help description:
Each exclusion uses regular expression pattern matching, and must be separated by a new line.
myapp/src/main/web/.*.html
myapp/src/main/web/.*.jpeg
myapp/src/main/web/.*.gif
The example above illustrates that if only html/jpeg/gif files have been committed to the GitHub repository a build will not occur.
More information on regular expressions can be found here.
Other trigger types will have something similar to the notion of "Excluded regions".
Moreover, Jenkins has added functionality like this in various ways as discussed in resolved Jira tickets such as JENKINS-21418 and JENKINS-36614.
I hope that helps. I know that it isn't a global function in a Jenkins file, as per the question, but I think that it can be a viable solution to the problem in general.
add a comment |
In your job's configuration under the Build Triggers section, you should be able to find what you are looking for (usually under the Advanced tab). For example, on my instance of Jenkins, for the "GitHub Pull Request Builder" trigger type, after clicking the Advanced button, you can see an "Excluded regions" textbox with the following help description:
Each exclusion uses regular expression pattern matching, and must be separated by a new line.
myapp/src/main/web/.*.html
myapp/src/main/web/.*.jpeg
myapp/src/main/web/.*.gif
The example above illustrates that if only html/jpeg/gif files have been committed to the GitHub repository a build will not occur.
More information on regular expressions can be found here.
Other trigger types will have something similar to the notion of "Excluded regions".
Moreover, Jenkins has added functionality like this in various ways as discussed in resolved Jira tickets such as JENKINS-21418 and JENKINS-36614.
I hope that helps. I know that it isn't a global function in a Jenkins file, as per the question, but I think that it can be a viable solution to the problem in general.
add a comment |
In your job's configuration under the Build Triggers section, you should be able to find what you are looking for (usually under the Advanced tab). For example, on my instance of Jenkins, for the "GitHub Pull Request Builder" trigger type, after clicking the Advanced button, you can see an "Excluded regions" textbox with the following help description:
Each exclusion uses regular expression pattern matching, and must be separated by a new line.
myapp/src/main/web/.*.html
myapp/src/main/web/.*.jpeg
myapp/src/main/web/.*.gif
The example above illustrates that if only html/jpeg/gif files have been committed to the GitHub repository a build will not occur.
More information on regular expressions can be found here.
Other trigger types will have something similar to the notion of "Excluded regions".
Moreover, Jenkins has added functionality like this in various ways as discussed in resolved Jira tickets such as JENKINS-21418 and JENKINS-36614.
I hope that helps. I know that it isn't a global function in a Jenkins file, as per the question, but I think that it can be a viable solution to the problem in general.
In your job's configuration under the Build Triggers section, you should be able to find what you are looking for (usually under the Advanced tab). For example, on my instance of Jenkins, for the "GitHub Pull Request Builder" trigger type, after clicking the Advanced button, you can see an "Excluded regions" textbox with the following help description:
Each exclusion uses regular expression pattern matching, and must be separated by a new line.
myapp/src/main/web/.*.html
myapp/src/main/web/.*.jpeg
myapp/src/main/web/.*.gif
The example above illustrates that if only html/jpeg/gif files have been committed to the GitHub repository a build will not occur.
More information on regular expressions can be found here.
Other trigger types will have something similar to the notion of "Excluded regions".
Moreover, Jenkins has added functionality like this in various ways as discussed in resolved Jira tickets such as JENKINS-21418 and JENKINS-36614.
I hope that helps. I know that it isn't a global function in a Jenkins file, as per the question, but I think that it can be a viable solution to the problem in general.
answered Jan 3 at 7:16
entpnerdentpnerd
4,85721843
4,85721843
add a comment |
add a comment |
Jenkins declarative language checkout presumably also cover excludedRegions which is the same option @entpnerd described in the GitHub Pull Request Builder plugin:
excludedRegions
If set, and Jenkins is set to poll for changes, Jenkins will ignore
any files and/or folders in this list when determining if a build
needs to be triggered.
See a Jenkinsfile example in a similar stackoverflow question. Jira issue JENKINS-36195 requested for this functionality and JENKINS-36836 provided working and not working cases and why.
The reality is that it is not working and it is not planned to be included:
There have been some brief discussions about it, but there are no
plans to address it
so I would go for Jenkins GUI polling configuration.
add a comment |
Jenkins declarative language checkout presumably also cover excludedRegions which is the same option @entpnerd described in the GitHub Pull Request Builder plugin:
excludedRegions
If set, and Jenkins is set to poll for changes, Jenkins will ignore
any files and/or folders in this list when determining if a build
needs to be triggered.
See a Jenkinsfile example in a similar stackoverflow question. Jira issue JENKINS-36195 requested for this functionality and JENKINS-36836 provided working and not working cases and why.
The reality is that it is not working and it is not planned to be included:
There have been some brief discussions about it, but there are no
plans to address it
so I would go for Jenkins GUI polling configuration.
add a comment |
Jenkins declarative language checkout presumably also cover excludedRegions which is the same option @entpnerd described in the GitHub Pull Request Builder plugin:
excludedRegions
If set, and Jenkins is set to poll for changes, Jenkins will ignore
any files and/or folders in this list when determining if a build
needs to be triggered.
See a Jenkinsfile example in a similar stackoverflow question. Jira issue JENKINS-36195 requested for this functionality and JENKINS-36836 provided working and not working cases and why.
The reality is that it is not working and it is not planned to be included:
There have been some brief discussions about it, but there are no
plans to address it
so I would go for Jenkins GUI polling configuration.
Jenkins declarative language checkout presumably also cover excludedRegions which is the same option @entpnerd described in the GitHub Pull Request Builder plugin:
excludedRegions
If set, and Jenkins is set to poll for changes, Jenkins will ignore
any files and/or folders in this list when determining if a build
needs to be triggered.
See a Jenkinsfile example in a similar stackoverflow question. Jira issue JENKINS-36195 requested for this functionality and JENKINS-36836 provided working and not working cases and why.
The reality is that it is not working and it is not planned to be included:
There have been some brief discussions about it, but there are no
plans to address it
so I would go for Jenkins GUI polling configuration.
edited Jan 8 at 15:36
answered Jan 8 at 14:59
Carlos CaveroCarlos Cavero
4811413
4811413
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53965624%2fexcluding-yaml-and-md-files-from-auto-triggering-the-jenkins-build%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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