From 098f65b7d49ae7a6c413c8706d5fd2777ae8e857 Mon Sep 17 00:00:00 2001 From: Frank Becker Date: Sat, 15 Nov 2014 20:55:04 +0100 Subject: 450874: use git instead of bzr for setup of the test instances Change-Id: I9e4847734fcd40e88e51bc91ec119197fc995fd8 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=450874 --- .../modules/bugzilla/manifests/defaultsites.pp | 67 ++++++------- .../modules/bugzilla/manifests/init.pp | 5 +- .../modules/bugzilla/manifests/site.pp | 107 +++++++++++++++------ .../bugzilla/templates/installPerlModules.sh.erb | 2 +- .../modules/bugzilla/templates/service.json.erb | 23 +---- 5 files changed, 111 insertions(+), 93 deletions(-) diff --git a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/defaultsites.pp b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/defaultsites.pp index 323d9bfd4..cacaccc5e 100644 --- a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/defaultsites.pp +++ b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/defaultsites.pp @@ -23,11 +23,6 @@ define bugzilla::defaultsites($base = $bugzilla::bugzillaBase, $userOwner = $bug /* Sites */ - bugzilla::site { "bugzilla-3.6.13": - major => "3", - minor => "6", - } - bugzilla::site { "bugzilla-3.6.13-custom-wf": major => "3", minor => "6", @@ -44,13 +39,6 @@ define bugzilla::defaultsites($base = $bugzilla::bugzillaBase, $userOwner = $bug desciptorfile => "DescriptorFile-custom-wf-and-status.txt" } - bugzilla::site { "bugzilla-3.6.13-xml-rpc-disabled": - major => "3", - minor => "6", - branchTag => "bugzilla-3.6.13", - xmlrpc_enabled => false, - } - bugzilla::site { "bugzilla-4.0.15": major => "4", minor => "0", @@ -74,39 +62,40 @@ define bugzilla::defaultsites($base = $bugzilla::bugzillaBase, $userOwner = $bug envdefault => true, } -bugzilla::site { "bugzilla-4.5.6": - major => "4", - minor => "5", - branch => "trunk", - branchTag => "bugzilla-4.5.6", - envversion => "4.5.6", +/* + bugzilla::site { "bugzilla-master": + major => "5", + minor => "1", + branchTag => "HEAD", + envversion => "5.1", } - -bugzilla::site { "bugzilla-rest-4.5.6": - major => "4", - minor => "5", - branch => "trunk", - branchTag => "bugzilla-4.5.6", + + bugzilla::site { "bugzilla-rest-master": + major => "5", + minor => "1", + branchTag => "HEAD", + envversion => "5.1", + envtype => "bugzillaREST", rest_enabled => true, - envversion => "4.5.6", - envinfo => "4.5.6, REST enabled" } - - bugzilla::site { "bugzilla-trunk": - major => "4", - minor => "5", - branch => "trunk", - branchTag => "trunk", +*/ + bugzilla::site { "bugzilla-5.0": + major => "5", + minor => "0", + branch => "5.0", + branchTag => "5.0", envversion => "4.5.6+", } -bugzilla::site { "bugzilla-rest-trunk": - major => "4", - minor => "5", - branch => "trunk", - branchTag => "trunk", - envversion => "4.5.6+", - envdefault_rest => true, + bugzilla::site { "bugzilla-5.0-rest": + major => "5", + minor => "0", + branch => "5.0", + branchTag => "5.0", + envtype => "bugzillaREST", rest_enabled => true, + envdefault_rest => true, + envversion => "4.5.6+", } + } \ No newline at end of file diff --git a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/init.pp b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/init.pp index ff437f763..a9cdac338 100644 --- a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/init.pp +++ b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/init.pp @@ -30,7 +30,6 @@ class bugzilla { "libapache2-mod-fcgid", "libapache2-mod-php5", "mysql-server", - "bzr", "make", "perl-doc", "php5", @@ -49,7 +48,9 @@ class bugzilla { "liburi-perl", "libsoap-lite-perl", "libtemplate-perl", - "patchutils",] + "patchutils", + "git", + ] package { $requirements: ensure => "installed", diff --git a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/site.pp b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/site.pp index dcf96bda0..32269a64a 100644 --- a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/site.pp +++ b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/site.pp @@ -12,7 +12,7 @@ define bugzilla::site ( $major, $minor, - $branch = " ", + $branch = "${major}.${minor}", $bugz_dbname = regsubst($title, '([^.-]+)([.-]+)', '\1_', 'G'), $bugz_user = $bugzilla::dbuser, $bugz_password = $bugzilla::dbuserPassword, @@ -41,9 +41,7 @@ define bugzilla::site ( $propertyanz = 0 $confDir = "$base/conf.d" - if $branch == "trunk" { - $envinfo1 = "trunk" - } elsif $custom_wf { + if $custom_wf { $envinfo1 = "Custom Workflow" } elsif $custom_wf_and_status { $envinfo1 = "Custom Workflow and Status" @@ -92,51 +90,96 @@ define bugzilla::site ( } else { $VersionCreateName = "value" } - - if ($branch == "trunk") { - $branchName = "$branch" + + if $branch == "master" { + if $branchTag == "HEAD" { + exec { "master master git fetch $version": + command => "git fetch", + onlyif => "/usr/bin/test -d $base/$version", + cwd => "$base/$version", + user => "root", + timeout => 300, + logoutput => true, + require => Exec["prepare bugzilla"], + notify => Exec["end extract bugzilla $version"], + } + exec { "master master git clone $version": + command => "git clone http://git.mozilla.org/bugzilla/bugzilla $base/$version", + cwd => "$base", + user => "$userOwner", + timeout => 300, + creates => "$base/$version", + require => Exec["prepare bugzilla"], + notify => Exec["end extract bugzilla $version"], + } + } else { + exec { "master $branchTag git clone $version": + command => "git clone -b $branch http://git.mozilla.org/bugzilla/bugzilla $base/$version", + cwd => "$base", + user => "$userOwner", + timeout => 300, + creates => "$base/$version", + require => Exec["prepare bugzilla"], + } + exec { "master $branchTag git checkout $version": + command => "git checkout $branchTag", + cwd => "$base/$version", + user => "$userOwner", + logoutput => true, + timeout => 300, + require => Exec["master $branchTag git clone $version"], + notify => Exec["end extract bugzilla $version"], + } + } } else { - $branchName = "${major}.${minor}" - } - - if $branchTag == "trunk" { -# -# always delete existing trunk folders to get the latest version from the trunk -# - exec { "delete bugzilla $version": - command => "rm -R $base/$version", + exec { "$branch $branchTag git fetch $version": + command => "git fetch", onlyif => "/usr/bin/test -d $base/$version", - cwd => "$base", + cwd => "$base/$version", user => "root", timeout => 300, logoutput => true, - require => Exec["prepare bugzilla"] - } - exec { "extract bugzilla $version": - command => "bzr co bzr://bzr.mozilla.org/bugzilla/$branchName $version", + require => Exec["prepare bugzilla"], + notify => Exec["end extract bugzilla $version"], + } + exec { "$branch $branchTag git clone $version": + command => "git clone http://git.mozilla.org/bugzilla/bugzilla $base/$version", cwd => "$base", user => "$userOwner", timeout => 300, creates => "$base/$version", - require => Exec["delete bugzilla $version"] + require => Exec["prepare bugzilla"], } - } else { - exec { "extract bugzilla $version": - command => "bzr co -r tag:$branchTag bzr://bzr.mozilla.org/bugzilla/$branchName $version", - cwd => "$base", - user => "$userOwner", - timeout => 300, - creates => "$base/$version", - require => Exec["prepare bugzilla"] + if $branchTag == "HEAD" { + exec { "$branch $branchTag dummy git checkout $version": + command => "echo '$branch $branchTag dummy git checkout $version'", + logoutput => true, + require => Exec["$branch $branchTag git clone $version"], + notify => Exec["end extract bugzilla $version"], + } + } else { + exec { "$branch $branchTag git checkout $version": + command => "git checkout $branchTag", + cwd => "$base/$version", + user => "$userOwner", + timeout => 300, + require => Exec["$branch $branchTag git clone $version"], + notify => Exec["end extract bugzilla $version"], + } } } + + exec { "end extract bugzilla $version": + command => "echo 'end extract bugzilla $version $branch $branchTag'", + logoutput => true, + } file { "$base/$version/installPerlModules.sh": content => template('bugzilla/installPerlModules.sh.erb'), owner => "$userOwner", group => "$userGroup", mode => 0755, - require => Exec["extract bugzilla $version"], + require => Exec["end extract bugzilla $version"], } exec { "post extract bugzilla $version": @@ -144,7 +187,7 @@ define bugzilla::site ( cwd => "$base/$version", creates => "$base/$version/CGI.out", user => "$userOwner", - timeout => 600, + timeout => 3000, require => File["$base/$version/installPerlModules.sh"] } diff --git a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/installPerlModules.sh.erb b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/installPerlModules.sh.erb index 40b3af76e..b5e097f66 100644 --- a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/installPerlModules.sh.erb +++ b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/installPerlModules.sh.erb @@ -16,7 +16,7 @@ echo "start3: $(date +'%d/%m/%Y %H:%M:%S:%3N')" echo "ende3: $(date +'%d/%m/%Y %H:%M:%S:%3N')" <% end %> <% end %> -<% if @operatingsystemrelease = "12.04" && @envversion > "4.4" %> +<% if @operatingsystemrelease == "12.04" %> echo "start4: $(date +'%d/%m/%Y %H:%M:%S:%3N')" /usr/bin/perl install-module.pl Template echo "ende4: $(date +'%d/%m/%Y %H:%M:%S:%3N')" diff --git a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/service.json.erb b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/service.json.erb index bb46d7512..162d7bde9 100644 --- a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/service.json.erb +++ b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/service.json.erb @@ -5,29 +5,14 @@ "info": "<%= envinfo_intern %>", "properties":{ <% if @envdefault %><% if propertyanz.to_i > 0 %> ,<% else %> <% end %><% propertyanz = propertyanz.to_i -%><% propertyanz += 1 -%>"default": "1"<% end %> -<% if @custom_wf %><% if propertyanz.to_i > 0 %> ,<% else %> <% end %><% propertyanz = propertyanz.to_i -%><% propertyanz += 1 -%>"custom_wf": "<%= custom_wf %>"<% end %> -<% if @custom_wf_and_status %><% if propertyanz.to_i > 0 %> ,<% else %> <% end %><% propertyanz = propertyanz.to_i -%><% propertyanz += 1 -%>"custom_wf_and_status": "<%= custom_wf_and_status %>"<% end %> -<% if !@xmlrpc_enabled %><% if propertyanz.to_i > 0 %> ,<% else %> <% end %><% propertyanz = propertyanz.to_i -%><% propertyanz += 1 -%>"xmlrpc_enabled": "<%= xmlrpc_enabled %>"<% end %> -<% if @desciptorfile > " " %><% if propertyanz.to_i > 0 %> ,<% else %> <% end %><% propertyanz = propertyanz.to_i -%><% propertyanz += 1 -%>"desciptorfile": "<%= desciptorfile %>"<% end %> -<% if @usebugaliases %><% if propertyanz.to_i > 0 %> ,<% else %> <% end %><% propertyanz = propertyanz.to_i -%><% propertyanz += 1 -%>"usebugaliases": "<%= usebugaliases %>"<% end %> -<% if @rest_enabled %><% if propertyanz.to_i > 0 %> ,<% else %> <% end %><% propertyanz = propertyanz.to_i -%><% propertyanz += 1 -%>"rest_enabled": "<%= rest_enabled %>"<% end %> - } -} -<% if @rest_enabled %> -,{ - "type": "bugzillaREST", - "url": "/<%= envid %>", - "version": "<%= envversion %>", - "info": "<%= envinfo_intern %>", - <% propertyanz = 0 -%> - "properties":{ <% if @envdefault_rest %><% if propertyanz.to_i > 0 %> ,<% else %> <% end %><% propertyanz = propertyanz.to_i -%><% propertyanz += 1 -%>"default": "1"<% end %> <% if @custom_wf %><% if propertyanz.to_i > 0 %> ,<% else %> <% end %><% propertyanz = propertyanz.to_i -%><% propertyanz += 1 -%>"custom_wf": "<%= custom_wf %>"<% end %> <% if @custom_wf_and_status %><% if propertyanz.to_i > 0 %> ,<% else %> <% end %><% propertyanz = propertyanz.to_i -%><% propertyanz += 1 -%>"custom_wf_and_status": "<%= custom_wf_and_status %>"<% end %> <% if !@xmlrpc_enabled %><% if propertyanz.to_i > 0 %> ,<% else %> <% end %><% propertyanz = propertyanz.to_i -%><% propertyanz += 1 -%>"xmlrpc_enabled": "<%= xmlrpc_enabled %>"<% end %> <% if @desciptorfile > " " %><% if propertyanz.to_i > 0 %> ,<% else %> <% end %><% propertyanz = propertyanz.to_i -%><% propertyanz += 1 -%>"desciptorfile": "<%= desciptorfile %>"<% end %> <% if @usebugaliases %><% if propertyanz.to_i > 0 %> ,<% else %> <% end %><% propertyanz = propertyanz.to_i -%><% propertyanz += 1 -%>"usebugaliases": "<%= usebugaliases %>"<% end %> - <% if propertyanz.to_i > 0 %> ,<% else %> <% end %><% propertyanz = propertyanz.to_i -%><% propertyanz += 1 -%>"rest_enabled": "<%= rest_enabled %>" +<% if @branch %><% if propertyanz.to_i > 0 %> ,<% else %> <% end %><% propertyanz = propertyanz.to_i -%><% propertyanz += 1 -%>"branch": "<%= branch %>"<% end %> +<% if @branchTag %><% if propertyanz.to_i > 0 %> ,<% else %> <% end %><% propertyanz = propertyanz.to_i -%><% propertyanz += 1 -%>"branchTag": "<%= branchTag %>"<% end %> +<% if @rest_enabled %><% if propertyanz.to_i > 0 %> ,<% else %> <% end %><% propertyanz = propertyanz.to_i -%><% propertyanz += 1 -%>"rest_enabled": "<%= rest_enabled %>"<% end %> } -} -<% end %> \ No newline at end of file +} \ No newline at end of file -- cgit v1.2.3