From d434fd93d0f16bfbd49ef77c4ca371c19fdac2b0 Mon Sep 17 00:00:00 2001 From: "John L. Villalovos" Date: Wed, 21 Feb 2018 09:04:50 -0800 Subject: [PATCH] Change gerritbot to install from git Previously gerritbot installed from a release version. So any change to gerritbot requires a new release of gerritbot before it can come into effect. Change it to install the current git master branch for gerritbot and use that. Change-Id: Id229306960a9aa6ccf6241662e7172fce8150d33 --- manifests/init.pp | 25 +++++++++++++++++++++---- metadata.json | 1 + 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 08cb7df..0e81fca 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -9,21 +9,38 @@ class gerritbot( $ssh_rsa_key_contents = undef, $ssh_rsa_pubkey_contents = undef, $vhost_name = $::fqdn, + # Where to fetch the git repository from + $git_source_repo = 'https://git.openstack.org/openstack-infra/gerritbot', + # Destination directory for the git repository + $git_root_dir = '/opt/gerritbot', + # The git branch + $git_revision_branch = 'master', ) { include ::pip - package { 'gerritbot': + # Clone the git repository + vcsrepo { $git_root_dir: ensure => latest, - provider => openstack_pip, + provider => git, + revision => $git_revision_branch, + source => $git_source_repo, require => Class['pip'], } + # Install gerritbot using pip + exec { 'install-gerritbot' : + command => "pip install -U -r${git_root_dir}/requirements.txt && pip install --no-deps -U ${git_root_dir}", + path => '/usr/local/bin:/usr/bin:/bin/', + refreshonly => true, + subscribe => Vcsrepo[$git_root_dir], + } + file { '/etc/init.d/gerritbot': ensure => present, group => 'root', mode => '0555', owner => 'root', - require => Package['gerritbot'], + require => Exec['install-gerritbot'], source => 'puppet:///modules/gerritbot/gerritbot.init', } @@ -33,7 +50,7 @@ class gerritbot( hasrestart => true, require => File['/etc/init.d/gerritbot'], subscribe => [ - Package['gerritbot'], + Exec['install-gerritbot'], File['/etc/gerritbot/gerritbot.config'], File['/etc/gerritbot/channel_config.yaml'], ], diff --git a/metadata.json b/metadata.json index db493c4..8c2c91f 100644 --- a/metadata.json +++ b/metadata.json @@ -8,5 +8,6 @@ "project_page": "http://docs.openstack.org/infra/system-config/", "issues_url": "https://storyboard.openstack.org/#!/project/717", "dependencies": [ + {"name":"openstackinfra/vcsrepo","version_requirement":">= 0.0.8"} ] }