aboutsummaryrefslogtreecommitdiffstats
path: root/modules/buildsystem/manifests/create_upload_dir.rb
blob: dd30d00d12d4d1e6f514ad9b13442afc1224f6ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
define "create_upload_dir", :owner, :group, :releases do
    states = ["todo","done","failure","queue","rejected"]

    file @name, :ensure => 'directory', :owner => @owner, :group => @group 

    for st in states do
        file [@name, st].join('/'), :ensure => 'directory', :owner => @owner, :group => @group 
        
        @releases.each{|rel, repositories|
            file [@name, st, rel].join('/'), :ensure => 'directory', :owner => @owner, :group => @group
        
            repositories.each{|rep, medias|
                file [@name, st, rel, rep].join('/'), :ensure => 'directory', :owner => @owner, :group => @group
        
                for med in medias do
                    if st == 'done'
                       file [@name, st, rel, rep, med].join('/'), :ensure => 'directory', :owner => @owner, :group => @group, :mode => 0775
                    else
                       file [@name, st, rel, rep, med].join('/'), :ensure => 'directory', :owner => @owner, :group => @group
                    end
                end 
            }
        }
    end
end