Upgrade groups portal instances to use manifest based deployment

Both staging and productive groups instances will use the manifest
published at tarballs.openstack.org/groups/drupal-updates catalog.
It helps to separate the staging and prod deployment source
versions, passed in package_branch parameter. Drush dsd tool updated
to v0.9, and puppet sitedeploy and siteupdate resources were also
refactored to support drush-dl package provider parameters.

Change-Id: I8299c063ea774a85554c2406c6cb6ccb007fb182
This commit is contained in:
Marton Kiss 2014-10-20 15:16:37 +02:00
parent 921c6cff3e
commit b33a3a436d
5 changed files with 13 additions and 41 deletions

View File

@ -22,8 +22,8 @@
# - download_dir: download directory, local copy of release tarball lives here
define drupal::drush (
$drushdsdtar = 'https://github.com/mkissam/drush-dsd/archive/v0.8.tar.gz',
$basedrushdsdtar = 'drush-dsd-0.8.tar.gz',
$drushdsdtar = 'https://github.com/mkissam/drush-dsd/archive/v0.9.tar.gz',
$basedrushdsdtar = 'drush-dsd-0.9.tar.gz',
$download_dir = '/srv/downloads',
) {

View File

@ -187,55 +187,24 @@ class drupal (
require => File["${site_root}/etc"],
}
# add site distro tarball from http repository including
# md5 hash file
exec { "download:${package_branch}.md5":
command => "/usr/bin/wget --timestamping ${package_repository}/${package_branch}.md5 -O /tmp/${package_branch}.md5",
logoutput => 'on_failure',
cwd => '/tmp'
}
file { "/srv/downloads/${package_branch}.md5":
ensure => present,
source => "/tmp/${package_branch}.md5",
owner => 'root',
group => 'root',
mode => '0644',
require => [ Exec["download:${package_branch}.md5"], File['/srv/downloads'] ]
}
exec { "download:${package_branch}.tar.gz":
command => "/usr/bin/wget ${package_repository}/${package_branch}.tar.gz -O /srv/downloads/${package_branch}.tar.gz",
logoutput => 'on_failure',
refreshonly => true,
subscribe => File["/srv/downloads/${package_branch}.md5"],
require => File['/srv/downloads'],
}
# deploy a site from scratch when site status is 'NOT INSTALLED'
exec { "sitedeploy-${site_name}":
command => "/usr/bin/drush dsd-init @${site_alias} /srv/downloads/${package_branch}.tar.gz",
command => "/usr/bin/drush dsd-init @${site_alias}",
logoutput => true,
timeout => 600,
onlyif => "/usr/bin/drush dsd-status @${site_alias} | /bin/grep -c 'NOT INSTALLED'",
refreshonly => true,
subscribe => File["/srv/downloads/${package_branch}.md5"],
require => [
Exec["download:${package_branch}.md5"],
File['/etc/drush/aliases.drushrc.php'],
]
}
# update the site into a new slot when a remote update available
exec { "siteupdate-${site_name}":
command => "/usr/bin/drush dsd-update @${site_alias} /srv/downloads/${package_branch}.tar.gz",
command => "/usr/bin/drush dsd-update @${site_alias}",
logoutput => true,
timeout => 600,
onlyif => "/usr/bin/drush dsd-status @${site_alias} | /bin/grep -c 'UPDATE'",
refreshonly => true,
subscribe => File["/srv/downloads/${package_branch}.md5"],
require => [
Exec["download:${package_branch}.md5"],
File['/etc/drush/aliases.drushrc.php'],
Exec["sitedeploy-${site_name}"],
]

View File

@ -23,7 +23,10 @@ $aliases['<%= @site_alias %>'] = array(
'profile' => '<%= @site_profile %>',
'default-admin-password' => '<%= @site_admin_password %>',
'disable-features-revert' => FALSE,
'package-provider' => 'static-tarball',
'package-provider' => 'drush-dl',
'package-repository' => '<%= @package_repository %>',
'package-branch' => '<%= @package_branch %>',
'package-dist-name' => 'groups',
<% if @package_branch == 'dev' %>
'package-dev-branch' => TRUE,
<% end %>
);

View File

@ -50,8 +50,8 @@ class openstack_project::groups (
site_alias => 'groups',
site_profile => 'groups',
site_base_url => 'http://groups.openstack.org',
package_repository => 'http://tarballs.openstack.org/groups',
package_branch => 'groups-latest',
package_repository => 'http://tarballs.openstack.org/groups/drupal-updates/release-history',
package_branch => 'stable',
conf_cron_key => $conf_cron_key,
conf_markdown_directory => '/srv/groups-static-pages',
conf_ga_account => 'UA-17511903-1',

View File

@ -52,8 +52,8 @@ class openstack_project::groups_dev (
site_alias => 'groupsdev',
site_profile => 'groups',
site_base_url => 'http://groups-dev.openstack.org',
package_repository => 'http://tarballs.openstack.org/groups',
package_branch => 'groups-latest',
package_repository => 'http://tarballs.openstack.org/groups/drupal-updates/release-history',
package_branch => 'dev',
conf_cron_key => $conf_cron_key,
conf_markdown_directory => '/srv/groups-static-pages',
require => [ Class['openstack_project::server'],