SCM repo: add ignore-projects option

Change-Id: I4468b699fa86d0790dbb01457d2e67e276740940
Signed-off-by: Lucas Dutra Nunes <ldnunes@ossystems.com.br>
This commit is contained in:
Lucas Dutra Nunes 2016-03-16 11:16:31 -03:00
parent c81f71a2c4
commit 0791f9724a
4 changed files with 19 additions and 0 deletions

View File

@ -573,6 +573,8 @@ def repo(parser, xml_parent, data):
(optional)
:arg str manifest-group: Only retrieve those projects in the manifest
tagged with the provided group name (optional)
:arg list(str) ignore-projects: a list of projects in which changes would
not be considered to trigger a build when pooling (optional)
:arg str destination-dir: Location relative to the workspace root to clone
under (optional)
:arg str repo-url: custom url to retrieve the repo application (optional)
@ -645,6 +647,13 @@ def repo(parser, xml_parent, data):
else:
xe.text = str(val)
# ignore-projects does not follow the same pattern of the other parameters,
# so process it here:
ip = XML.SubElement(scm, 'ignoreProjects', {'class': 'linked-hash-set'})
ignored_projects = data.get('ignore-projects', [''])
for ignored_project in ignored_projects:
XML.SubElement(ip, 'string').text = str(ignored_project)
def store(parser, xml_parent, data):
"""yaml: store

View File

@ -27,6 +27,9 @@
<noTags>false</noTags>
<trace>false</trace>
<showAllChanges>false</showAllChanges>
<ignoreProjects class="linked-hash-set">
<string/>
</ignoreProjects>
</hudson.plugins.repo.RepoScm>
<hudson.plugins.git.GitSCM>
<configVersion>2</configVersion>

View File

@ -23,5 +23,9 @@
remote=&quot;gerrit&quot; revision=&quot;master&quot; /&gt;
&lt;/manifest&gt;
</localManifest>
<ignoreProjects class="linked-hash-set">
<string>static-project</string>
<string>unimportant-project</string>
</ignoreProjects>
</scm>
</project>

View File

@ -4,6 +4,9 @@ scm:
manifest-branch: stable
manifest-file: repo.xml
manifest-group: drivers
ignore-projects:
- static-project
- unimportant-project
destination-dir: build
repo-url: https://internal.net/projects/repo
mirror-dir: ~/git/project/