Attempt to more fully manage project creation.

Manage project creation via yaml files. Also,
Modify the manage_projects scripts to configure Gerrit project ACLs.
This change expects the project yaml to exist. The change will clone the
project for the localhost Gerrit install. It will then checkout the
meta/config ref, copy the ACL config file into the repo, commit, and
push to the origin. The ACL config location should be specified in the
projects.yaml file with the acl_config key.

For this to work the ACLs will need to be copied by Puppet from Puppet
to the Gerrit host. Add the file resource to do this as well.

Change-Id: I15a1ec13b381dce3c115c01c21f404ab79e72cc4
Reviewed-on: https://review.openstack.org/15352
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Approved: Monty Taylor <mordred@inaugust.com>
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Tested-by: Jenkins
This commit is contained in:
Monty Taylor 2012-11-04 22:20:36 +01:00 committed by Jenkins
parent 74aa19ac3b
commit cf03da2d2b
3 changed files with 25 additions and 1 deletions

View File

@ -16,6 +16,12 @@
# Github pull requests closer reads a project config file called projects.yaml
# It should look like:
# - homepage: http://openstack.org
# team-id: 153703
# has-wiki: False
# has-issues: False
# has-downloads: False
# ---
# - project: PROJECT_NAME
# options:
# - has-pull-requests
@ -54,7 +60,7 @@ Please visit http://wiki.openstack.org/GerritWorkflow and follow the instruction
secure_config = ConfigParser.ConfigParser()
secure_config.read(GITHUB_SECURE_CONFIG)
config = yaml.load(open(PROJECTS_YAML))
(defaults, config) = [config for config in yaml.load_all(open(PROJECTS_YAML))]
if secure_config.has_option("github", "oauth_token"):
ghub = github.Github(secure_config.get("github", "oauth_token"))

View File

@ -1,6 +1,8 @@
class github(
$username,
$oauth_token,
$project_username,
$project_password,
$projects = []
) {
include pip
@ -55,6 +57,19 @@ class github(
],
}
file { '/etc/github/github-projects.secure.config':
ensure => present,
content => template('github/github-projects.secure.config.erb'),
group => 'github',
mode => '0440',
owner => 'root',
replace => true,
require => [
Group['github'],
File['/etc/github']
],
}
file { '/usr/local/github':
ensure => directory,
group => 'root',

View File

@ -0,0 +1,3 @@
[github]
username = <%= project_username %>
password = <%= project_password %>