Replace manual git work with vcsrepo module.

Change-Id: Ia0f3acd50aab07cc83d13cd12c8f7fc67f1c697d
Reviewed-on: https://review.openstack.org/10832
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: Monty Taylor <mordred@inaugust.com>
Tested-by: Jenkins
This commit is contained in:
Monty Taylor 2012-08-04 09:55:37 -05:00 committed by Jenkins
parent 14284283bb
commit 4bf4a1ea7f
2 changed files with 14 additions and 27 deletions

View File

@ -1,26 +1,9 @@
class vcs {
# if we already have the git repo the pull updates
exec { "update_meetbot_repo":
command => "git pull --ff-only",
cwd => "/opt/meetbot",
path => "/bin:/usr/bin",
onlyif => "test -d /opt/meetbot"
}
# otherwise get a new clone of it
exec { "clone_meebot_repo":
command => "git clone https://github.com/openstack-ci/meetbot.git /opt/meetbot",
path => "/bin:/usr/bin",
onlyif => "test ! -d /opt/meetbot"
}
}
class meetbot {
stage { 'first': before => Stage['main'] }
class { 'vcs':
stage => 'first'
vcsrepo { "/opt/meetbot":
ensure => latest,
provider => git,
source => "https://github.com/openstack-ci/meetbot.git",
}
user { "meetbot":
@ -41,7 +24,7 @@ class meetbot {
service { "nginx":
ensure => running,
hasrestart => true
hasrestart => true,
}
file { "/var/lib/meetbot":
@ -54,7 +37,8 @@ class meetbot {
ensure => directory,
recurse => true,
source => "/opt/meetbot/MeetBot",
require => Package["supybot"]
require => [Package["supybot"],
Vcsrepo["/opt/meetbot"]]
}
file { "/etc/nginx/sites-enabled/default":

View File

@ -88,7 +88,8 @@ define meetbot::site($nick, $nickpass, $network, $server, $url=$fqdn, $channels,
recurse => true,
source => "/opt/meetbot/ircmeeting",
owner => 'meetbot',
require => File["/var/lib/meetbot/${name}"]
require => [Vcsrepo["/opt/meetbot"],
File["/var/lib/meetbot/${name}"]]
}
file { "/var/lib/meetbot/${name}/ircmeeting/meetingLocalConfig.py":
@ -114,7 +115,9 @@ define meetbot::site($nick, $nickpass, $network, $server, $url=$fqdn, $channels,
service { "${name}-meetbot":
provider => upstart,
ensure => running,
require => File["/etc/init/${name}-meetbot.conf"],
subscribe => [File["/usr/share/pyshared/supybot/plugins/MeetBot"], File["/var/lib/meetbot/${name}/ircmeeting"]]
require => [Vcsrepo["/opt/meetbot"],
File["/etc/init/${name}-meetbot.conf"]],
subscribe => [File["/usr/share/pyshared/supybot/plugins/MeetBot"],
File["/var/lib/meetbot/${name}/ircmeeting"]]
}
}