diff options
-rw-r--r-- | deployment/mga_buildsystem/manifests/config.pp | 34 | ||||
-rw-r--r-- | modules/buildsystem/manifests/create_upload_dir.rb | 16 | ||||
-rw-r--r-- | modules/buildsystem/manifests/mgarepo.pp | 28 | ||||
-rw-r--r-- | modules/buildsystem/manifests/var/distros.pp | 3 |
4 files changed, 47 insertions, 34 deletions
diff --git a/deployment/mga_buildsystem/manifests/config.pp b/deployment/mga_buildsystem/manifests/config.pp index c6afd765..4311856d 100644 --- a/deployment/mga_buildsystem/manifests/config.pp +++ b/deployment/mga_buildsystem/manifests/config.pp @@ -18,4 +18,38 @@ class mga_buildsystem::config { uploadmail_from => "root@${::domain}", uploadmail_to => "packages-commits@ml.${::domain}", } + + $std_repos = ['release','updates_testing','backports_testing','backports','updates'] + $std_medias = { + 'core' => $std_repos, + 'nonfree' => $std_repos, + 'tainted' => $std_repos, + } + $infra_medias = { + 'infra' => ['release'], + } + class { 'buildsystem::var::distros': + distros => { + 'cauldron' => { + 'medias' => $std_medias, + }, + + '1' => { + 'medias' => $std_medias, + }, + + '2' => { + 'medias' => $std_medias, + }, + + 'infra_1' => { + 'medias' => $infra_medias, + }, + + 'infra_2' => { + 'medias' => $infra_medias, + }, + } + } + } diff --git a/modules/buildsystem/manifests/create_upload_dir.rb b/modules/buildsystem/manifests/create_upload_dir.rb index dcd27afe..f3e16a3e 100644 --- a/modules/buildsystem/manifests/create_upload_dir.rb +++ b/modules/buildsystem/manifests/create_upload_dir.rb @@ -1,4 +1,6 @@ hostclass "buildsystem::create_upload_dir" do + include 'buildsystem::var::scheduler' + include 'buildsystem::var::distros' states = ["todo","done","failure","queue","rejected"] owner = scope.lookupvar('buildsystem::var::scheduler::login') group = owner @@ -9,17 +11,17 @@ hostclass "buildsystem::create_upload_dir" do for st in states do file [uploads_dir, st].join('/'), :ensure => 'directory', :owner => owner, :group => group - scope.lookupvar('buildsystem::mgarepo::releases').each{|rel, repositories| + scope.lookupvar('buildsystem::var::distros::distros').each{|rel, distro| file [uploads_dir, st, rel].join('/'), :ensure => 'directory', :owner => owner, :group => group + medias = distro['medias'] + medias.each{|media, repos| + file [uploads_dir, st, rel, media].join('/'), :ensure => 'directory', :owner => owner, :group => group - repositories.each{|rep, medias| - file [uploads_dir, st, rel, rep].join('/'), :ensure => 'directory', :owner => owner, :group => group - - for med in medias do + for repo in repos do if st == 'done' - file [uploads_dir, st, rel, rep, med].join('/'), :ensure => 'directory', :owner => owner, :group => group, :mode => 0775 + file [uploads_dir, st, rel, media, repo].join('/'), :ensure => 'directory', :owner => owner, :group => group, :mode => 0775 else - file [uploads_dir, st, rel, rep, med].join('/'), :ensure => 'directory', :owner => owner, :group => group + file [uploads_dir, st, rel, media, repo].join('/'), :ensure => 'directory', :owner => owner, :group => group end end } diff --git a/modules/buildsystem/manifests/mgarepo.pp b/modules/buildsystem/manifests/mgarepo.pp index 6078ee51..3f9e2f40 100644 --- a/modules/buildsystem/manifests/mgarepo.pp +++ b/modules/buildsystem/manifests/mgarepo.pp @@ -2,6 +2,7 @@ class buildsystem::mgarepo { include buildsystem::var::scheduler include buildsystem::var::groups include buildsystem::var::binrepo + include buildsystem::create_upload_dir $sched_login = $buildsystem::var::scheduler::login $sched_home_dir = $buildsystem::var::scheduler::homedir @@ -32,33 +33,6 @@ class buildsystem::mgarepo { # require => File[$sched_home_dir], #} - #FIXME This config information should be moved out of this class - $releases = { - 'cauldron' => { - 'core' => ['release','updates_testing','backports_testing','backports','updates'], - 'nonfree' => ['release','updates_testing','backports_testing','backports','updates'], - 'tainted' => ['release','updates_testing','backports_testing','backports','updates'], - }, - '1' => { - 'core' => ['release','updates_testing','backports_testing','backports','updates'], - 'nonfree' => ['release','updates_testing','backports_testing','backports','updates'], - 'tainted' => ['release','updates_testing','backports_testing','backports','updates'], - }, - '2' => { - 'core' => ['release','updates_testing','backports_testing','backports','updates'], - 'nonfree' => ['release','updates_testing','backports_testing','backports','updates'], - 'tainted' => ['release','updates_testing','backports_testing','backports','updates'], - }, - 'infra_1' => { - 'infra' => ['release'] - }, - 'infra_2' => { - 'infra' => ['release'] - }, - } - - include buildsystem::create_upload_dir - tidy { "$sched_home_dir/uploads": type => 'ctime', recurse => true, diff --git a/modules/buildsystem/manifests/var/distros.pp b/modules/buildsystem/manifests/var/distros.pp new file mode 100644 index 00000000..cd53abfd --- /dev/null +++ b/modules/buildsystem/manifests/var/distros.pp @@ -0,0 +1,3 @@ +class buildsystem::var::distros( + $distros +) { } |