Openstackid site-update feature

Update openstackid site into a new slot when a new release available
on tarballs.openstackid/openstackid site.

Change-Id: I59580f5a9d7b4ef09daea4c981977327d29804ff
This commit is contained in:
Marton Kiss 2014-03-27 17:24:50 +01:00
parent d48edc42fc
commit 4546cf9f2a
2 changed files with 20 additions and 1 deletions

View File

@ -140,6 +140,10 @@ function site_update() {
target_dir="$SITE_ROOT/$TARGET_SLOT" target_dir="$SITE_ROOT/$TARGET_SLOT"
rm -rf $target_dir rm -rf $target_dir
mkdir $target_dir mkdir $target_dir
# fetch catalog and write actual version
fetch_catalog
RELEASE_VERSION=`catalog_get_version`
echo $RELEASE_VERSION > $target_dir/release
# fetch and extract release tarball # fetch and extract release tarball
umask 0027 umask 0027
if [[ $SOURCE_TARBALL == http* ]]; then if [[ $SOURCE_TARBALL == http* ]]; then

View File

@ -214,4 +214,19 @@ class openstackid (
Package[$php5_packages] ], Package[$php5_packages] ],
} }
} exec { 'update-site':
path => '/usr/bin:/bin:/usr/local/bin',
command => '/opt/deploy/deploy.sh update openstackid',
onlyif => '/opt/deploy/deploy.sh status openstackid | grep UPDATE',
logoutput => on_failure,
require => [
File['/opt/deploy/conf.d/openstackid.conf'],
Apache::Vhost[$vhost_name],
File['/etc/openstackid/recaptcha.php'],
File['/etc/openstackid/database.php'],
File['/etc/openstackid/log.php'],
File['/etc/openstackid/environment.php'],
Package[$php5_packages] ],
}
}