Switch jenkins to project-config
Change-Id: If7b98d6d842946c0f7e9c4925834117e7a833313
This commit is contained in:
parent
8347b74ace
commit
def93bc086
@ -112,6 +112,7 @@ node 'review-dev.openstack.org' {
|
||||
# Node-OS: precise
|
||||
node 'jenkins.openstack.org' {
|
||||
class { 'openstack_project::jenkins':
|
||||
project_config_repo => 'https://git.openstack.org/openstack-infra/project-config',
|
||||
jenkins_jobs_password => hiera('jenkins_jobs_password', 'XXX'),
|
||||
jenkins_ssh_private_key => hiera('jenkins_ssh_private_key_contents', 'XXX'),
|
||||
ssl_cert_file_contents => hiera('jenkins_ssl_cert_file_contents', 'XXX'),
|
||||
|
@ -5,7 +5,8 @@ class jenkins::job_builder (
|
||||
$username = '',
|
||||
$password = '',
|
||||
$git_revision = 'master',
|
||||
$git_url = 'https://git.openstack.org/openstack-infra/jenkins-job-builder'
|
||||
$git_url = 'https://git.openstack.org/openstack-infra/jenkins-job-builder',
|
||||
$config_dir = '',
|
||||
) {
|
||||
|
||||
# A lot of things need yaml, be conservative requiring this package to avoid
|
||||
@ -40,6 +41,19 @@ class jenkins::job_builder (
|
||||
ensure => directory,
|
||||
}
|
||||
|
||||
file { '/etc/jenkins_jobs/config':
|
||||
ensure => directory,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0755',
|
||||
recurse => true,
|
||||
purge => true,
|
||||
force => true,
|
||||
source => $config_dir,
|
||||
require => File['/etc/jenkins_jobs'],
|
||||
notify => Exec['jenkins_jobs_update'],
|
||||
}
|
||||
|
||||
exec { 'jenkins_jobs_update':
|
||||
command => 'jenkins-jobs update --delete-old /etc/jenkins_jobs/config',
|
||||
timeout => '600',
|
||||
|
@ -15,7 +15,8 @@ class openstack_project::jenkins (
|
||||
$ssl_chain_file_contents = '',
|
||||
$jenkins_ssh_private_key = '',
|
||||
$zmq_event_receivers = [],
|
||||
$sysadmins = []
|
||||
$sysadmins = [],
|
||||
$project_config_repo = '',
|
||||
) {
|
||||
include openstack_project
|
||||
|
||||
@ -116,25 +117,18 @@ class openstack_project::jenkins (
|
||||
}
|
||||
|
||||
if $manage_jenkins_jobs == true {
|
||||
class { 'project_config':
|
||||
url => $project_config_repo,
|
||||
}
|
||||
|
||||
class { '::jenkins::job_builder':
|
||||
url => "https://${vhost_name}/",
|
||||
username => $jenkins_jobs_username,
|
||||
password => $jenkins_jobs_password,
|
||||
git_revision => $jenkins_git_revision,
|
||||
git_url => $jenkins_git_url,
|
||||
}
|
||||
|
||||
file { '/etc/jenkins_jobs/config':
|
||||
ensure => directory,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0755',
|
||||
recurse => true,
|
||||
purge => true,
|
||||
force => true,
|
||||
source =>
|
||||
'puppet:///modules/openstack_project/jenkins_job_builder/config',
|
||||
notify => Exec['jenkins_jobs_update'],
|
||||
config_dir => $::project_config::jenkins_job_builder_config_dir,
|
||||
require => $::project_config::config_dir,
|
||||
}
|
||||
|
||||
file { '/etc/default/jenkins':
|
||||
|
@ -5,6 +5,7 @@
|
||||
class openstack_project::slave_common(
|
||||
$include_pypy = false,
|
||||
$sudo = false,
|
||||
$project_config_repo = 'https://git.openstack.org/openstack-infra/project-config',
|
||||
){
|
||||
vcsrepo { '/opt/requirements':
|
||||
ensure => latest,
|
||||
@ -13,6 +14,10 @@ class openstack_project::slave_common(
|
||||
source => 'https://git.openstack.org/openstack/requirements',
|
||||
}
|
||||
|
||||
class { 'project_config':
|
||||
url => $project_config_repo,
|
||||
}
|
||||
|
||||
file { '/usr/local/jenkins/slave_scripts':
|
||||
ensure => directory,
|
||||
owner => 'root',
|
||||
@ -21,8 +26,9 @@ class openstack_project::slave_common(
|
||||
recurse => true,
|
||||
purge => true,
|
||||
force => true,
|
||||
require => File['/usr/local/jenkins'],
|
||||
source => 'puppet:///modules/openstack_project/slave_scripts',
|
||||
require => [File['/usr/local/jenkins'],
|
||||
$::project_config::config_dir],
|
||||
source => $::project_config::jenkins_scripts_dir,
|
||||
}
|
||||
|
||||
file { '/home/jenkins/.pydistutils.cfg':
|
||||
|
@ -31,5 +31,7 @@ class project_config(
|
||||
}
|
||||
}
|
||||
|
||||
$jenkins_job_builder_config_dir = "/etc/project-config/${base}jenkins/jobs"
|
||||
$jenkins_scripts_dir = "/etc/project-config/${base}jenkins/scripts"
|
||||
$zuul_layout_dir = "/etc/project-config/${base}zuul"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user