Add branches arg to createProject
This new functiona argument will allow callers to set the default project branch on repo creation. It takes a list, all branches will be created with the first being repo HEAD. Change-Id: Iae5a71662740678e663bcd73d6ac660559db5d9a
This commit is contained in:
parent
95e17ddf05
commit
6058d994b8
@ -1,6 +1,7 @@
|
|||||||
- job:
|
- job:
|
||||||
name: gerritlib-jeepyb-integration
|
name: gerritlib-jeepyb-integration
|
||||||
description: Run manage_projects with gerritlib from source against Gerrit
|
description: Run manage_projects with gerritlib from source against Gerrit
|
||||||
|
pre-run: playbooks/jeepyb-integration/pre.yaml
|
||||||
run: playbooks/jeepyb-integration/run.yaml
|
run: playbooks/jeepyb-integration/run.yaml
|
||||||
post-run: playbooks/jeepyb-integration/post.yaml
|
post-run: playbooks/jeepyb-integration/post.yaml
|
||||||
required-projects:
|
required-projects:
|
||||||
|
@ -257,7 +257,7 @@ class Gerrit(object):
|
|||||||
self._setMember('remove', group, member)
|
self._setMember('remove', group, member)
|
||||||
|
|
||||||
def createProject(self, project, require_change_id=True, empty_repo=False,
|
def createProject(self, project, require_change_id=True, empty_repo=False,
|
||||||
description=None):
|
description=None, branches=None):
|
||||||
cmd = 'gerrit create-project'
|
cmd = 'gerrit create-project'
|
||||||
if require_change_id:
|
if require_change_id:
|
||||||
cmd = '%s --require-change-id' % cmd
|
cmd = '%s --require-change-id' % cmd
|
||||||
@ -266,6 +266,10 @@ class Gerrit(object):
|
|||||||
if description:
|
if description:
|
||||||
cmd = "%s --description \"%s\"" % \
|
cmd = "%s --description \"%s\"" % \
|
||||||
(cmd, description.replace('"', r'\"'))
|
(cmd, description.replace('"', r'\"'))
|
||||||
|
if branches:
|
||||||
|
# Branches should be a list. The first entry will be repo HEAD.
|
||||||
|
for branch in branches:
|
||||||
|
cmd = "%s --branch \"%s\"" % (cmd, branch)
|
||||||
version = None
|
version = None
|
||||||
try:
|
try:
|
||||||
version = self.parseGerritVersion(self.getVersion())
|
version = self.parseGerritVersion(self.getVersion())
|
||||||
|
3
playbooks/jeepyb-integration/pre.yaml
Normal file
3
playbooks/jeepyb-integration/pre.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
- hosts: all
|
||||||
|
roles:
|
||||||
|
- name: ensure-pip
|
@ -10,6 +10,7 @@
|
|||||||
acl-config: tools/acls/test/test.config
|
acl-config: tools/acls/test/test.config
|
||||||
groups:
|
groups:
|
||||||
- testing
|
- testing
|
||||||
|
default-branch: main
|
||||||
- project: test/test-repo-3
|
- project: test/test-repo-3
|
||||||
description: A retired repo
|
description: A retired repo
|
||||||
acl-config: tools/acls/test/retired.config
|
acl-config: tools/acls/test/retired.config
|
||||||
|
Loading…
x
Reference in New Issue
Block a user