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:
|
||||
name: gerritlib-jeepyb-integration
|
||||
description: Run manage_projects with gerritlib from source against Gerrit
|
||||
pre-run: playbooks/jeepyb-integration/pre.yaml
|
||||
run: playbooks/jeepyb-integration/run.yaml
|
||||
post-run: playbooks/jeepyb-integration/post.yaml
|
||||
required-projects:
|
||||
|
@ -257,7 +257,7 @@ class Gerrit(object):
|
||||
self._setMember('remove', group, member)
|
||||
|
||||
def createProject(self, project, require_change_id=True, empty_repo=False,
|
||||
description=None):
|
||||
description=None, branches=None):
|
||||
cmd = 'gerrit create-project'
|
||||
if require_change_id:
|
||||
cmd = '%s --require-change-id' % cmd
|
||||
@ -266,6 +266,10 @@ class Gerrit(object):
|
||||
if description:
|
||||
cmd = "%s --description \"%s\"" % \
|
||||
(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
|
||||
try:
|
||||
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
|
||||
groups:
|
||||
- testing
|
||||
default-branch: main
|
||||
- project: test/test-repo-3
|
||||
description: A retired repo
|
||||
acl-config: tools/acls/test/retired.config
|
||||
|
Loading…
Reference in New Issue
Block a user