diff options
author | Christian Hofstaedtler <christian@hofstaedtler.name> | 2014-07-15 14:03:25 +0200 |
---|---|---|
committer | Christian Hofstaedtler <christian@hofstaedtler.name> | 2014-07-27 00:41:04 +0200 |
commit | 8999a87c13c3b0c470c5ef21e1688484c5df76a0 (patch) | |
tree | 33795edfbfae506dc1a9fc5efbfe125c3b9a509d | |
parent | d83301564066ddc962d8ddbec06c8cfa8545ad54 (diff) | |
download | python-jenkins-job-builder-8999a87c13c3b0c470c5ef21e1688484c5df76a0.tar.gz python-jenkins-job-builder-8999a87c13c3b0c470c5ef21e1688484c5df76a0.tar.xz python-jenkins-job-builder-8999a87c13c3b0c470c5ef21e1688484c5df76a0.zip |
Add support for 'ignore-notify' in git SCM
This option is named "Don't trigger a build on commit notifications"
in the Jenkins Web UI.
Change-Id: I338af61f8bfdef1545d1ea206e6874cda38957cd
20 files changed, 151 insertions, 1 deletions
diff --git a/jenkins_jobs/modules/scm.py b/jenkins_jobs/modules/scm.py index 97a07b30..8eb87f1f 100644 --- a/jenkins_jobs/modules/scm.py +++ b/jenkins_jobs/modules/scm.py @@ -80,6 +80,7 @@ def git(self, xml_parent, data): :arg str reference-repo: Path of the reference repo to use during clone :arg str scm-name: The unique scm name for this Git SCM :arg bool wipe-workspace: Wipe out workspace before build + :arg bool ignore-notify: Ignore notifyCommit URL accesses (default false) :arg str browser: what repository browser to use (default '(Auto)') :arg str browser-url: url for the repository browser :arg str browser-version: version of the repository browser (GitLab) @@ -133,6 +134,7 @@ def git(self, xml_parent, data): ('skip-tag', 'skipTag', False), ('scm-name', 'scmName', ''), ("shallow-clone", "useShallowClone", False), + ("ignore-notify", "ignoreNotifyCommit", False), ] choosing_strategies = { diff --git a/tests/macros/scm/multi-scms001.xml b/tests/macros/scm/multi-scms001.xml index aa2f3f50..741f9ea1 100644 --- a/tests/macros/scm/multi-scms001.xml +++ b/tests/macros/scm/multi-scms001.xml @@ -43,6 +43,7 @@ <skipTag>false</skipTag> <scmName/> <useShallowClone>false</useShallowClone> + <ignoreNotifyCommit>false</ignoreNotifyCommit> </scm> <scm class="hudson.plugins.git.GitSCM"> <configVersion>2</configVersion> @@ -77,6 +78,7 @@ <skipTag>false</skipTag> <scmName/> <useShallowClone>false</useShallowClone> + <ignoreNotifyCommit>false</ignoreNotifyCommit> </scm> </scms> </scm> diff --git a/tests/macros/scm/multi-scms002.xml b/tests/macros/scm/multi-scms002.xml index 7f3e4608..480a4d35 100644 --- a/tests/macros/scm/multi-scms002.xml +++ b/tests/macros/scm/multi-scms002.xml @@ -55,6 +55,7 @@ <skipTag>false</skipTag> <scmName/> <useShallowClone>false</useShallowClone> + <ignoreNotifyCommit>false</ignoreNotifyCommit> </scm> </scms> </scm> diff --git a/tests/macros/scm/scm002.xml b/tests/macros/scm/scm002.xml index 96758eb1..3c3c2f46 100644 --- a/tests/macros/scm/scm002.xml +++ b/tests/macros/scm/scm002.xml @@ -41,6 +41,7 @@ <skipTag>false</skipTag> <scmName/> <useShallowClone>false</useShallowClone> + <ignoreNotifyCommit>false</ignoreNotifyCommit> </scm> <builders/> <publishers/> diff --git a/tests/scm/fixtures/git-ignore-notify01.xml b/tests/scm/fixtures/git-ignore-notify01.xml new file mode 100644 index 00000000..2e3bd0df --- /dev/null +++ b/tests/scm/fixtures/git-ignore-notify01.xml @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="utf-8"?> +<project> + <scm class="hudson.plugins.git.GitSCM"> + <configVersion>2</configVersion> + <userRemoteConfigs> + <hudson.plugins.git.UserRemoteConfig> + <name>origin</name> + <refspec>+refs/heads/*:refs/remotes/origin/*</refspec> + <url>https://github.com/openstack-infra/jenkins-job-builder.git</url> + </hudson.plugins.git.UserRemoteConfig> + </userRemoteConfigs> + <branches> + <hudson.plugins.git.BranchSpec> + <name>master</name> + </hudson.plugins.git.BranchSpec> + </branches> + <excludedUsers/> + <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/> + <disableSubmodules>false</disableSubmodules> + <recursiveSubmodules>false</recursiveSubmodules> + <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations> + <authorOrCommitter>false</authorOrCommitter> + <clean>true</clean> + <wipeOutWorkspace>true</wipeOutWorkspace> + <pruneBranches>false</pruneBranches> + <remotePoll>false</remotePoll> + <gitTool>Default</gitTool> + <submoduleCfg class="list"/> + <relativeTargetDir/> + <reference/> + <gitConfigName/> + <gitConfigEmail/> + <skipTag>false</skipTag> + <scmName/> + <useShallowClone>false</useShallowClone> + <ignoreNotifyCommit>true</ignoreNotifyCommit> + </scm> +</project> diff --git a/tests/scm/fixtures/git-ignore-notify01.yaml b/tests/scm/fixtures/git-ignore-notify01.yaml new file mode 100644 index 00000000..8d249417 --- /dev/null +++ b/tests/scm/fixtures/git-ignore-notify01.yaml @@ -0,0 +1,7 @@ +scm: + - git: + url: https://github.com/openstack-infra/jenkins-job-builder.git + branches: + - master + clean: true + ignore-notify: true diff --git a/tests/scm/fixtures/git-ignore-notify02.xml b/tests/scm/fixtures/git-ignore-notify02.xml new file mode 100644 index 00000000..5b43eef7 --- /dev/null +++ b/tests/scm/fixtures/git-ignore-notify02.xml @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="utf-8"?> +<project> + <scm class="hudson.plugins.git.GitSCM"> + <configVersion>2</configVersion> + <userRemoteConfigs> + <hudson.plugins.git.UserRemoteConfig> + <name>origin</name> + <refspec>+refs/heads/*:refs/remotes/origin/*</refspec> + <url>https://github.com/openstack-infra/jenkins-job-builder.git</url> + </hudson.plugins.git.UserRemoteConfig> + </userRemoteConfigs> + <branches> + <hudson.plugins.git.BranchSpec> + <name>master</name> + </hudson.plugins.git.BranchSpec> + </branches> + <excludedUsers/> + <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/> + <disableSubmodules>false</disableSubmodules> + <recursiveSubmodules>false</recursiveSubmodules> + <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations> + <authorOrCommitter>false</authorOrCommitter> + <clean>true</clean> + <wipeOutWorkspace>true</wipeOutWorkspace> + <pruneBranches>false</pruneBranches> + <remotePoll>false</remotePoll> + <gitTool>Default</gitTool> + <submoduleCfg class="list"/> + <relativeTargetDir/> + <reference/> + <gitConfigName/> + <gitConfigEmail/> + <skipTag>false</skipTag> + <scmName/> + <useShallowClone>false</useShallowClone> + <ignoreNotifyCommit>false</ignoreNotifyCommit> + </scm> +</project> diff --git a/tests/scm/fixtures/git-ignore-notify02.yaml b/tests/scm/fixtures/git-ignore-notify02.yaml new file mode 100644 index 00000000..88eadf23 --- /dev/null +++ b/tests/scm/fixtures/git-ignore-notify02.yaml @@ -0,0 +1,7 @@ +scm: + - git: + url: https://github.com/openstack-infra/jenkins-job-builder.git + branches: + - master + clean: true + ignore-notify: false diff --git a/tests/scm/fixtures/git-ignore-notify03.xml b/tests/scm/fixtures/git-ignore-notify03.xml new file mode 100644 index 00000000..5b43eef7 --- /dev/null +++ b/tests/scm/fixtures/git-ignore-notify03.xml @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="utf-8"?> +<project> + <scm class="hudson.plugins.git.GitSCM"> + <configVersion>2</configVersion> + <userRemoteConfigs> + <hudson.plugins.git.UserRemoteConfig> + <name>origin</name> + <refspec>+refs/heads/*:refs/remotes/origin/*</refspec> + <url>https://github.com/openstack-infra/jenkins-job-builder.git</url> + </hudson.plugins.git.UserRemoteConfig> + </userRemoteConfigs> + <branches> + <hudson.plugins.git.BranchSpec> + <name>master</name> + </hudson.plugins.git.BranchSpec> + </branches> + <excludedUsers/> + <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/> + <disableSubmodules>false</disableSubmodules> + <recursiveSubmodules>false</recursiveSubmodules> + <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations> + <authorOrCommitter>false</authorOrCommitter> + <clean>true</clean> + <wipeOutWorkspace>true</wipeOutWorkspace> + <pruneBranches>false</pruneBranches> + <remotePoll>false</remotePoll> + <gitTool>Default</gitTool> + <submoduleCfg class="list"/> + <relativeTargetDir/> + <reference/> + <gitConfigName/> + <gitConfigEmail/> + <skipTag>false</skipTag> + <scmName/> + <useShallowClone>false</useShallowClone> + <ignoreNotifyCommit>false</ignoreNotifyCommit> + </scm> +</project> diff --git a/tests/scm/fixtures/git-ignore-notify03.yaml b/tests/scm/fixtures/git-ignore-notify03.yaml new file mode 100644 index 00000000..1f233fba --- /dev/null +++ b/tests/scm/fixtures/git-ignore-notify03.yaml @@ -0,0 +1,6 @@ +scm: + - git: + url: https://github.com/openstack-infra/jenkins-job-builder.git + branches: + - master + clean: true diff --git a/tests/scm/fixtures/git-multiple-remotes.xml b/tests/scm/fixtures/git-multiple-remotes.xml index c657d5fd..76a57677 100644 --- a/tests/scm/fixtures/git-multiple-remotes.xml +++ b/tests/scm/fixtures/git-multiple-remotes.xml @@ -39,5 +39,6 @@ <skipTag>false</skipTag> <scmName/> <useShallowClone>false</useShallowClone> + <ignoreNotifyCommit>false</ignoreNotifyCommit> </scm> -</project>
\ No newline at end of file +</project> diff --git a/tests/scm/fixtures/git-shallow-clone01.xml b/tests/scm/fixtures/git-shallow-clone01.xml index 8dfe2f72..e11a56f2 100644 --- a/tests/scm/fixtures/git-shallow-clone01.xml +++ b/tests/scm/fixtures/git-shallow-clone01.xml @@ -34,5 +34,6 @@ <skipTag>false</skipTag> <scmName/> <useShallowClone>true</useShallowClone> + <ignoreNotifyCommit>false</ignoreNotifyCommit> </scm> </project> diff --git a/tests/scm/fixtures/git-shallow-clone02.xml b/tests/scm/fixtures/git-shallow-clone02.xml index 57fe8d7a..5b43eef7 100644 --- a/tests/scm/fixtures/git-shallow-clone02.xml +++ b/tests/scm/fixtures/git-shallow-clone02.xml @@ -33,5 +33,6 @@ <skipTag>false</skipTag> <scmName/> <useShallowClone>false</useShallowClone> + <ignoreNotifyCommit>false</ignoreNotifyCommit> </scm> </project> diff --git a/tests/scm/fixtures/git-shallow-clone03.xml b/tests/scm/fixtures/git-shallow-clone03.xml index 57fe8d7a..5b43eef7 100644 --- a/tests/scm/fixtures/git-shallow-clone03.xml +++ b/tests/scm/fixtures/git-shallow-clone03.xml @@ -33,5 +33,6 @@ <skipTag>false</skipTag> <scmName/> <useShallowClone>false</useShallowClone> + <ignoreNotifyCommit>false</ignoreNotifyCommit> </scm> </project> diff --git a/tests/scm/fixtures/git001.xml b/tests/scm/fixtures/git001.xml index a6fc207f..d86c15aa 100644 --- a/tests/scm/fixtures/git001.xml +++ b/tests/scm/fixtures/git001.xml @@ -36,6 +36,7 @@ <skipTag>false</skipTag> <scmName/> <useShallowClone>false</useShallowClone> + <ignoreNotifyCommit>false</ignoreNotifyCommit> <browser class="hudson.plugins.git.browser.GithubWeb"> <url>http://github.com/foo/example.git</url> </browser> diff --git a/tests/scm/fixtures/gitlab.xml b/tests/scm/fixtures/gitlab.xml index be772a9d..5f3cee06 100644 --- a/tests/scm/fixtures/gitlab.xml +++ b/tests/scm/fixtures/gitlab.xml @@ -33,6 +33,7 @@ <skipTag>false</skipTag> <scmName/> <useShallowClone>false</useShallowClone> + <ignoreNotifyCommit>false</ignoreNotifyCommit> <browser class="hudson.plugins.git.browser.GitLab"> <url>https://gitlab.example.com/foo/bar/</url> <version>5.2</version> diff --git a/tests/scm/fixtures/local-branch001.xml b/tests/scm/fixtures/local-branch001.xml index b272c053..c47b437b 100644 --- a/tests/scm/fixtures/local-branch001.xml +++ b/tests/scm/fixtures/local-branch001.xml @@ -33,6 +33,7 @@ <skipTag>false</skipTag> <scmName/> <useShallowClone>false</useShallowClone> + <ignoreNotifyCommit>false</ignoreNotifyCommit> <localBranch>master</localBranch> </scm> </project> diff --git a/tests/scm/fixtures/stash.xml b/tests/scm/fixtures/stash.xml index 8fba325c..6c039e4d 100644 --- a/tests/scm/fixtures/stash.xml +++ b/tests/scm/fixtures/stash.xml @@ -33,6 +33,7 @@ <skipTag>false</skipTag> <scmName/> <useShallowClone>false</useShallowClone> + <ignoreNotifyCommit>false</ignoreNotifyCommit> <browser class="hudson.plugins.git.browser.Stash"> <url>https://stash.example.com/projects/foo/repos/bar/</url> </browser> diff --git a/tests/yamlparser/fixtures/complete001.xml b/tests/yamlparser/fixtures/complete001.xml index 2d1fdc9e..86c98a07 100644 --- a/tests/yamlparser/fixtures/complete001.xml +++ b/tests/yamlparser/fixtures/complete001.xml @@ -41,6 +41,7 @@ <skipTag>false</skipTag> <scmName/> <useShallowClone>false</useShallowClone> + <ignoreNotifyCommit>false</ignoreNotifyCommit> <browser class="hudson.plugins.git.browser.GitWeb"> <url>http://review.openstack.org/gitweb?p=openstack-infra/jenkins-job-builder.git</url> </browser> diff --git a/tests/yamlparser/fixtures/scm_remote_deep_bug.xml b/tests/yamlparser/fixtures/scm_remote_deep_bug.xml index 63f9a810..b267a116 100644 --- a/tests/yamlparser/fixtures/scm_remote_deep_bug.xml +++ b/tests/yamlparser/fixtures/scm_remote_deep_bug.xml @@ -41,6 +41,7 @@ <skipTag>false</skipTag> <scmName/> <useShallowClone>false</useShallowClone> + <ignoreNotifyCommit>false</ignoreNotifyCommit> </scm> <builders/> <publishers/> |