summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Shubin <james@shubin.ca>2014-01-16 18:54:14 -0500
committerJames Shubin <james@shubin.ca>2014-01-16 19:14:48 -0500
commit30392fd0cb4e2bd0e39faea83915bfe8a6574bbc (patch)
treed2a6157afbd320db49833f12b95cf6c8dd510a19
parent856ebf4de0160165a255a80c2ede9eeaaa099b99 (diff)
downloadpuppet-gluster-30392fd0cb4e2bd0e39faea83915bfe8a6574bbc.tar.gz
puppet-gluster-30392fd0cb4e2bd0e39faea83915bfe8a6574bbc.tar.xz
puppet-gluster-30392fd0cb4e2bd0e39faea83915bfe8a6574bbc.zip
Add support for automatic qa-release detection.
Did this at the last minute for the "glusterfest". John Mark Walker now owes me two t-shirts, and a polo. Now it's in the permanent record ;)
-rw-r--r--manifests/repo.pp16
1 files changed, 15 insertions, 1 deletions
diff --git a/manifests/repo.pp b/manifests/repo.pp
index 3fccd2d..ca5cecf 100644
--- a/manifests/repo.pp
+++ b/manifests/repo.pp
@@ -37,13 +37,27 @@ class gluster::repo(
# \4 is the second part of the release, eg: el6
$real_v = regsubst("${version}", '^([\d\.]*)(\-([\d]{1,})\.([a-zA-Z\d]{1,}))?$', '\1')
- if "${real_v}" =~ /^(\d+)\.(\d+)$/ { # x.y
+ # search for qa style releases
+ $qa_pattern = '^([\d\.]*)(\-(0\.[\d]{1,}\.((alpha|beta|qa|rc)[\d]{1,}))\.([a-zA-Z\d]{1,}))?$'
+ $qa_type = regsubst("${version}", "${qa_pattern}", '\5')
+ $qa = "${qa_type}" ? {
+ /(alpha|beta|qa|rc)/ => true,
+ default => false,
+ }
+
+ if $qa {
+ $qa_folder = regsubst("${version}", "${qa_pattern}", '\1\4')
+ # look inside the qa-releases/ subfolder...
+ $base_v = "${base}qa-releases/${qa_folder}/"
+
+ } elsif "${real_v}" =~ /^(\d+)\.(\d+)$/ { # x.y
#$base_v = "${base}${1}.${2}/LATEST/" # same!
$base_v = "${base}${real_v}/LATEST/"
} elsif "${real_v}" =~ /^(\d+)\.(\d+)\.(\d+)$/ { # x.y.z
#$base_v = "${base}${1}.${2}/${1}.${2}.${3}/" # same!
$base_v = "${base}${1}.${2}/${real_v}/"
+
} else {
fail('The version string is invalid.')
}