aboutsummaryrefslogtreecommitdiffstats
path: root/modules/buildsystem
diff options
context:
space:
mode:
Diffstat (limited to 'modules/buildsystem')
-rw-r--r--modules/buildsystem/files/Mageia.pm53
-rw-r--r--modules/buildsystem/files/i586/media.cfg322
-rwxr-xr-xmodules/buildsystem/files/signbot/mga-signpackage (renamed from modules/buildsystem/templates/signbot/mga-signpackage)2
-rw-r--r--modules/buildsystem/files/signbot/sign-check-package (renamed from modules/buildsystem/templates/signbot/sign-check-package)4
-rw-r--r--modules/buildsystem/files/signbot/signbot-rpmmacros (renamed from modules/buildsystem/templates/signbot/signbot-rpmmacros)0
-rw-r--r--modules/buildsystem/files/x86_64/media.cfg381
-rw-r--r--modules/buildsystem/lib/puppet/parser/functions/group_members.rb10
-rw-r--r--modules/buildsystem/manifests/base.pp21
-rw-r--r--modules/buildsystem/manifests/binrepo.pp70
-rw-r--r--modules/buildsystem/manifests/buildnode.pp10
-rw-r--r--modules/buildsystem/manifests/create_upload_dir.rb29
-rw-r--r--modules/buildsystem/manifests/distros.rb97
-rw-r--r--modules/buildsystem/manifests/gatherer.pp2
-rw-r--r--modules/buildsystem/manifests/init.pp16
-rw-r--r--modules/buildsystem/manifests/iurt.pp26
-rw-r--r--modules/buildsystem/manifests/iurt/config.pp45
-rw-r--r--modules/buildsystem/manifests/iurt/init.pp31
-rw-r--r--modules/buildsystem/manifests/iurt/packages.pp2
-rw-r--r--modules/buildsystem/manifests/iurt/upload.pp8
-rw-r--r--modules/buildsystem/manifests/iurt/user.pp8
-rw-r--r--modules/buildsystem/manifests/mainnode.pp56
-rw-r--r--modules/buildsystem/manifests/maintdb.pp53
-rw-r--r--modules/buildsystem/manifests/media_cfg.pp17
-rw-r--r--modules/buildsystem/manifests/mgacreatehome.pp7
-rw-r--r--modules/buildsystem/manifests/mgarepo.pp57
-rw-r--r--modules/buildsystem/manifests/release.pp6
-rw-r--r--modules/buildsystem/manifests/repoctl.pp11
-rw-r--r--modules/buildsystem/manifests/repository.pp11
-rw-r--r--modules/buildsystem/manifests/rpmlint.pp16
-rw-r--r--modules/buildsystem/manifests/scheduler.pp58
-rw-r--r--modules/buildsystem/manifests/signbot.pp38
-rw-r--r--modules/buildsystem/manifests/sshkeys.pp5
-rw-r--r--modules/buildsystem/manifests/sshuser.pp10
-rw-r--r--modules/buildsystem/manifests/var/binrepo.pp15
-rw-r--r--modules/buildsystem/manifests/var/distros.pp126
-rw-r--r--modules/buildsystem/manifests/var/groups.pp9
-rw-r--r--modules/buildsystem/manifests/var/iurt.pp5
-rw-r--r--modules/buildsystem/manifests/var/maintdb.pp11
-rw-r--r--modules/buildsystem/manifests/var/mgarepo.pp22
-rw-r--r--modules/buildsystem/manifests/var/repository.pp9
-rw-r--r--modules/buildsystem/manifests/var/scheduler.pp31
-rw-r--r--modules/buildsystem/manifests/var/signbot.pp15
-rw-r--r--modules/buildsystem/manifests/var/webstatus.pp25
-rw-r--r--modules/buildsystem/manifests/var/youri.pp401
-rw-r--r--modules/buildsystem/manifests/webstatus.pp44
-rw-r--r--modules/buildsystem/manifests/youri_submit.pp55
-rw-r--r--modules/buildsystem/manifests/youri_submit_conf.pp6
-rw-r--r--modules/buildsystem/templates/binrepo/sudoers.binrepo2
-rwxr-xr-xmodules/buildsystem/templates/binrepo/upload-bin11
-rw-r--r--modules/buildsystem/templates/binrepo/vhost_binrepo.conf2
-rw-r--r--modules/buildsystem/templates/binrepo/wrapper.upload-bin6
-rw-r--r--modules/buildsystem/templates/bs-webstatus.conf32
-rwxr-xr-xmodules/buildsystem/templates/cleaner.rb235
-rw-r--r--modules/buildsystem/templates/cleaner_test.rb83
-rw-r--r--modules/buildsystem/templates/iurt.conf37
-rw-r--r--modules/buildsystem/templates/iurt/1.conf30
-rw-r--r--modules/buildsystem/templates/iurt/cauldron.conf30
-rw-r--r--modules/buildsystem/templates/iurt/infra_1.conf13
-rw-r--r--modules/buildsystem/templates/iurt/mandriva2010.1.conf30
-rw-r--r--modules/buildsystem/templates/iurt/sudoers.iurt1
-rwxr-xr-xmodules/buildsystem/templates/iurt2010.18
-rwxr-xr-xmodules/buildsystem/templates/maintdb/maintdb.bin102
-rw-r--r--modules/buildsystem/templates/maintdb/sudoers.maintdb6
-rw-r--r--modules/buildsystem/templates/maintdb/vhost_maintdb.conf2
-rw-r--r--modules/buildsystem/templates/maintdb/wrapper.maintdb9
-rw-r--r--modules/buildsystem/templates/media.cfg142
-rwxr-xr-xmodules/buildsystem/templates/mgacreatehome27
-rw-r--r--modules/buildsystem/templates/mgarepo.conf95
-rw-r--r--modules/buildsystem/templates/repoctl.conf40
-rw-r--r--modules/buildsystem/templates/signbot/sudoers.signpackage4
-rwxr-xr-xmodules/buildsystem/templates/submit_package.pl4
-rw-r--r--modules/buildsystem/templates/sudoers.iurt1
-rw-r--r--modules/buildsystem/templates/sudoers.youri3
-rw-r--r--modules/buildsystem/templates/sync2010.120
-rw-r--r--modules/buildsystem/templates/upload.conf134
-rw-r--r--modules/buildsystem/templates/vhost_pkgsubmit.conf4
-rw-r--r--modules/buildsystem/templates/vhost_repository.conf101
-rw-r--r--modules/buildsystem/templates/vhost_webstatus.conf13
-rw-r--r--modules/buildsystem/templates/youri/host.conf23
-rw-r--r--modules/buildsystem/templates/youri/submit-todo.conf186
-rw-r--r--modules/buildsystem/templates/youri/submit-upload.conf332
-rw-r--r--modules/buildsystem/templates/youri/submit.conf140
82 files changed, 2193 insertions, 1971 deletions
diff --git a/modules/buildsystem/files/Mageia.pm b/modules/buildsystem/files/Mageia.pm
index 109aeb29..443f6cb7 100644
--- a/modules/buildsystem/files/Mageia.pm
+++ b/modules/buildsystem/files/Mageia.pm
@@ -225,7 +225,7 @@ sub _get_distribution_paths {
my $arch = $package->get_arch();
$arch = $translate_arch{$arch} || $arch;
if ($arch eq 'noarch') {
- map { "$target/$_" } $self->get_extra_arches;
+ map { "$target/$_" } $self->get_target_arches($target);
} elsif ($arch eq 'src') {
die "no way to get distribution path using a $arch package";
} else {
@@ -264,26 +264,7 @@ sub get_replaced_packages {
my @replaced_packages =
$self->SUPER::get_replaced_packages($package, $target, $user_context, $app_context);
- # mandriva lib policy:
- # library package names change with revision, making mandatory to
- # duplicate older revisions search with a custom pattern
my $name = $package->get_name();
- if ($name =~ /^(lib\w+[a-zA-Z_])[\d_\.]+([-\w]*)$/) {
- push(@replaced_packages,
- grep { $package->compare($_) > 0 }
- map { PACKAGE_CLASS->new(file => $_) }
- $self->get_files(
- $self->{_install_root},
- $self->get_install_path($package, $target, $user_context, $app_context),
- PACKAGE_CLASS->get_pattern(
- $1 . '[\d_\.]+' . $2, # custom name pattern
- undef,
- undef,
- $package->get_arch()
- ),
- )
- );
- }
# kernel packages have the version in the name
# binary dkms built for old kernels have to be removed too
@@ -454,13 +435,14 @@ sub get_upload_newer_revisions {
my ($self, $package, $target, $user_context, $app_context) = @_;
croak "Not a class method" unless ref $self;
my $arch = $package->get_arch();
- my $name = $package->get_full_name;
+ my $name = $package->as_string();
$name =~ s/^\@\d+://;
my $pattern = $self->get_package_class()->get_pattern($package->get_name(), undef, undef, $arch);
my $media = $self->_get_media_config($target);
my @packages;
foreach my $state (@{$self->{_upload_state}}) {
foreach my $m (keys %{$media->{$arch}}) {
+ next if defined($user_context->{section}) and $user_context->{section} ne $m;
my $path = "$self->{_upload_root}/$state/$target/$m";
print "Looking for package $package revisions for $target in $path (pattern $pattern)\n" if $self->{_verbose};
find(
@@ -498,35 +480,6 @@ sub get_svn_url {
$self->{_svn}
}
-sub get_revisions {
- my ($self, $package, $target, $user_context, $app_context, $filter) = @_;
- croak "Not a class method" unless ref $self;
- print "Looking for package $package revisions for $target\n" if $self->{_verbose} > 0;
-
- my $arch = $app_context->{arch} || $user_context->{arch} || $package->get_arch();
- my $media_arch = $arch eq 'noarch' ? $self->{_noarch} : $arch;
- my $path = $arch eq 'src' ? "$target/SRPMS/" : "$target/$media_arch/media";
- my $media = $self->_get_section($package, $target, $user_context, $app_context);
- my $name = $package->get_name();
- my @packages = map { $self->get_package_class()->new(file => $_) }
- $self->get_files(
- $self->{_install_root},
- "$path/$media",
- $self->get_package_class()->get_pattern(
- $name,
- undef,
- undef,
- $package->get_arch(),
- )
- );
-
- @packages = grep { $filter->($_) } @packages if $filter;
-
- return
- sort { $b->compare($a) } # sort by revision order
- @packages;
-}
-
sub reject {
my ($self, $package, $target, $user_context, $app_context) = @_;
croak "Not a class method" unless ref $self;
diff --git a/modules/buildsystem/files/i586/media.cfg b/modules/buildsystem/files/i586/media.cfg
deleted file mode 100644
index a54c5730..00000000
--- a/modules/buildsystem/files/i586/media.cfg
+++ /dev/null
@@ -1,322 +0,0 @@
-[media_info]
-version=1
-mediacfg_version=2
-branch=Devel
-arch=i586
-xml-info=1
-
-[core/release]
-hdlist=hdlist_core_release.cz
-name=Core Release
-srpms=../../SRPMS/core/release
-media_type=official:free:release
-
-[debug/core/release]
-hdlist=hdlist_debug_core_release.cz
-name=Core Release Debug
-srpms=../../SRPMS/debug/core/release
-media_type=official:free:release:debug
-noauto=1
-
-[../../SRPMS/core/release]
-hdlist=hdlist_core_release.src.cz
-name=Core Release Sources
-rpms=core/release
-media_type=official:free:release:source
-noauto=1
-
-[core/updates]
-hdlist=hdlist_core_updates.cz
-name=Core Updates
-srpms=../../SRPMS/core/updates
-media_type=official:free:updates
-updates_for=core/release
-
-[debug/core/updates]
-hdlist=hdlist_debug_core_updates.cz
-name=Core Updates Debug
-srpms=../../SRPMS/debug/core/updates
-media_type=official:free:updates:debug
-noauto=1
-
-[../../SRPMS/core/updates]
-hdlist=hdlist_core_updates.src.cz
-name=Core Updates Sources
-rpms=core/updates
-media_type=official:free:updates:source
-noauto=1
-
-[core/updates_testing]
-hdlist=hdlist_core_updates_testing.cz
-name=Core Updates Testing
-srpms=../../SRPMS/core/updates_testing
-media_type=official:free:testing
-noauto=1
-
-[debug/core/updates_testing]
-hdlist=hdlist_debug_core_updates_testing.cz
-name=Core Updates Testing Debug
-srpms=../../SRPMS/debug/core/updates_testing
-media_type=official:free:testing:debug
-noauto=1
-
-[../../SRPMS/core/updates_testing]
-hdlist=hdlist_core_updates_testing.src.cz
-name=Core Updates Testing Sources
-rpms=core/updates_testing
-media_type=official:free:testing:source
-noauto=1
-
-[core/backports]
-hdlist=hdlist_core_backports.cz
-name=Core Backports
-srpms=../../SRPMS/core/backports
-media_type=official:free:backports
-noauto=1
-
-[debug/core/backports]
-hdlist=hdlist_debug_core_backports.cz
-name=Core Backports Debug
-srpms=../../SRPMS/debug/core/backports
-media_type=official:free:backports:debug
-noauto=1
-
-[../../SRPMS/core/backports]
-hdlist=hdlist_core_backports.src.cz
-name=Core Backports Sources
-rpms=core/backports
-media_type=official:free:backports:source
-noauto=1
-
-[core/backports_testing]
-hdlist=hdlist_core_backports_testing.cz
-name=Core Backports Testing
-srpms=../../SRPMS/core/backports_testing
-media_type=official:free:backports:testing
-noauto=1
-
-[debug/core/backports_testing]
-hdlist=hdlist_debug_core_backports_testing.cz
-name=Core Backports Testing Debug
-srpms=../../SRPMS/debug/core/backports_testing
-media_type=official:free:backports:testing:debug
-noauto=1
-
-[../../SRPMS/core/backports_testing]
-hdlist=hdlist_core_backports_testing.src.cz
-name=Core Backports Testing Sources
-rpms=core/backports_testing
-media_type=official:free:backports:testing:source
-noauto=1
-
-[nonfree/release]
-hdlist=hdlist_nonfree_release.cz
-name=Nonfree Release
-srpms=../../SRPMS/nonfree/release
-media_type=official:release
-noauto=1
-
-[debug/nonfree/release]
-hdlist=hdlist_debug_nonfree_release.cz
-name=Nonfree Release Debug
-srpms=../../SRPMS/debug/nonfree/release
-media_type=official:release:debug
-noauto=1
-
-[../../SRPMS/nonfree/release]
-hdlist=hdlist_nonfree_release.src.cz
-name=Nonfree Release Sources
-rpms=nonfree/release
-media_type=official:release:source
-noauto=1
-
-[nonfree/updates]
-hdlist=hdlist_nonfree_updates.cz
-name=Nonfree Updates
-srpms=../../SRPMS/nonfree/updates
-media_type=official:updates
-updates_for=nonfree/release
-noauto=1
-
-[debug/nonfree/updates]
-hdlist=hdlist_debug_nonfree_updates.cz
-name=Nonfree Updates Debug
-srpms=../../SRPMS/debug/nonfree/updates
-media_type=official:updates:debug
-noauto=1
-
-[../../SRPMS/nonfree/updates]
-hdlist=hdlist_nonfree_updates.src.cz
-name=Nonfree Updates Sources
-rpms=nonfree/updates
-media_type=official:updates:source
-noauto=1
-
-[nonfree/updates_testing]
-hdlist=hdlist_nonfree_updates_testing.cz
-name=Nonfree Updates Testing
-srpms=../../SRPMS/nonfree/updates_testing
-media_type=official:testing
-noauto=1
-
-[debug/nonfree/updates_testing]
-hdlist=hdlist_debug_nonfree_updates_testing.cz
-name=Nonfree Updates Testing Debug
-srpms=../../SRPMS/debug/nonfree/updates_testing
-media_type=official:testing:debug
-noauto=1
-
-[../../SRPMS/nonfree/updates_testing]
-hdlist=hdlist_nonfree_updates_testing.src.cz
-name=Nonfree Updates Testing Sources
-rpms=nonfree/updates_testing
-media_type=official:testing:source
-noauto=1
-
-[nonfree/backports]
-hdlist=hdlist_nonfree_backports.cz
-name=Nonfree Backports
-srpms=../../SRPMS/nonfree/backports
-media_type=official:backports
-noauto=1
-
-[debug/nonfree/backports]
-hdlist=hdlist_debug_nonfree_backports.cz
-name=Nonfree Backports Debug
-srpms=../../SRPMS/debug/nonfree/backports
-media_type=official:backports:debug
-noauto=1
-
-[../../SRPMS/nonfree/backports]
-hdlist=hdlist_nonfree_backports.src.cz
-name=Nonfree Backports Sources
-rpms=nonfree/backports
-media_type=official:backports:source
-noauto=1
-
-[nonfree/backports_testing]
-hdlist=hdlist_nonfree_backports_testing.cz
-name=Nonfree Backports Testing
-srpms=../../SRPMS/nonfree/backports_testing
-media_type=official:backports:testing
-noauto=1
-
-[debug/nonfree/backports_testing]
-hdlist=hdlist_debug_nonfree_backports_testing.cz
-name=Nonfree Backports Testing Debug
-srpms=../../SRPMS/debug/nonfree/backports_testing
-media_type=official:backports:testing:debug
-noauto=1
-
-[../../SRPMS/nonfree/backports_testing]
-hdlist=hdlist_nonfree_backports_testing.src.cz
-name=Nonfree Backports Testing Sources
-rpms=nonfree/backports_testing
-media_type=official:backports:testing:source
-noauto=1
-
-[tainted/release]
-hdlist=hdlist_tainted_release.cz
-name=Tainted Release
-srpms=../../SRPMS/tainted/release
-media_type=official:release
-noauto=1
-
-[debug/tainted/release]
-hdlist=hdlist_debug_tainted_release.cz
-name=Tainted Release Debug
-srpms=../../SRPMS/debug/tainted/release
-media_type=official:release:debug
-noauto=1
-
-[../../SRPMS/tainted/release]
-hdlist=hdlist_tainted_release.src.cz
-name=Tainted Release Sources
-rpms=tainted/release
-media_type=official:release:source
-noauto=1
-
-[tainted/updates]
-hdlist=hdlist_tainted_updates.cz
-name=Tainted Updates
-srpms=../../SRPMS/tainted/updates
-media_type=official:updates
-updates_for=tainted/release
-noauto=1
-
-[debug/tainted/updates]
-hdlist=hdlist_debug_tainted_updates.cz
-name=Tainted Updates Debug
-srpms=../../SRPMS/debug/tainted/updates
-media_type=official:updates:debug
-noauto=1
-
-[../../SRPMS/tainted/updates]
-hdlist=hdlist_tainted_updates.src.cz
-name=Tainted Updates Sources
-rpms=tainted/updates
-media_type=official:updates:source
-noauto=1
-
-[tainted/updates_testing]
-hdlist=hdlist_tainted_updates_testing.cz
-name=Tainted Updates Testing
-srpms=../../SRPMS/tainted/updates_testing
-media_type=official:testing
-noauto=1
-
-[debug/tainted/updates_testing]
-hdlist=hdlist_debug_tainted_updates_testing.cz
-name=Tainted Updates Testing Debug
-srpms=../../SRPMS/debug/tainted/updates_testing
-media_type=official:testing:debug
-noauto=1
-
-[../../SRPMS/tainted/updates_testing]
-hdlist=hdlist_tainted_updates_testing.src.cz
-name=Tainted Updates Testing Sources
-rpms=tainted/updates_testing
-media_type=official:testing:source
-noauto=1
-
-[tainted/backports]
-hdlist=hdlist_tainted_backports.cz
-name=Tainted Backports
-srpms=../../SRPMS/tainted/backports
-media_type=official:backports
-noauto=1
-
-[debug/tainted/backports]
-hdlist=hdlist_debug_tainted_backports.cz
-name=Tainted Backports Debug
-srpms=../../SRPMS/debug/tainted/backports
-media_type=official:backports:debug
-noauto=1
-
-[../../SRPMS/tainted/backports]
-hdlist=hdlist_tainted_backports.src.cz
-name=Tainted Backports Sources
-rpms=tainted/backports
-media_type=official:backports:source
-noauto=1
-
-[tainted/backports_testing]
-hdlist=hdlist_tainted_backports_testing.cz
-name=Tainted Backports Testing
-srpms=../../SRPMS/tainted/backports_testing
-media_type=official:backports:testing
-noauto=1
-
-[debug/tainted/backports_testing]
-hdlist=hdlist_debug_tainted_backports_testing.cz
-name=Tainted Backports Testing Debug
-srpms=../../SRPMS/debug/tainted/backports_testing
-media_type=official:backports:testing:debug
-noauto=1
-
-[../../SRPMS/tainted/backports_testing]
-hdlist=hdlist_tainted_backports_testing.src.cz
-name=Tainted Backports Testing Sources
-rpms=tainted/backports_testing
-media_type=official:backports:testing:source
-noauto=1
diff --git a/modules/buildsystem/templates/signbot/mga-signpackage b/modules/buildsystem/files/signbot/mga-signpackage
index bd88efeb..199dbe0e 100755
--- a/modules/buildsystem/templates/signbot/mga-signpackage
+++ b/modules/buildsystem/files/signbot/mga-signpackage
@@ -16,7 +16,7 @@ sub signpackage {
my $sign = RPM4::Sign->new(
name => $name,
path => $path,
- passphrase => '',
+ passphrase => '',
);
$sign->rpmssign($file)
diff --git a/modules/buildsystem/templates/signbot/sign-check-package b/modules/buildsystem/files/signbot/sign-check-package
index b0b01576..fc9704fd 100644
--- a/modules/buildsystem/templates/signbot/sign-check-package
+++ b/modules/buildsystem/files/signbot/sign-check-package
@@ -10,7 +10,8 @@ file="$1"
key="$2"
keydir="$3"
-tmpfile=`mktemp`
+tmpdir=`mktemp -d ${TMPDIR:-/tmp}/signbot-XXXXX`
+tmpfile="$tmpdir/$(basename $file)"
cp -pf "$file" "$tmpfile"
rpm --delsign "$tmpfile"
/usr/local/bin/mga-signpackage "$tmpfile" "$key" "$keydir"
@@ -33,3 +34,4 @@ do
/usr/local/bin/mga-signpackage "$tmpfile" "$key" "$keydir"
done
mv -f "$tmpfile" "$file"
+rmdir "$tmpdir"
diff --git a/modules/buildsystem/templates/signbot/signbot-rpmmacros b/modules/buildsystem/files/signbot/signbot-rpmmacros
index aab7e389..aab7e389 100644
--- a/modules/buildsystem/templates/signbot/signbot-rpmmacros
+++ b/modules/buildsystem/files/signbot/signbot-rpmmacros
diff --git a/modules/buildsystem/files/x86_64/media.cfg b/modules/buildsystem/files/x86_64/media.cfg
deleted file mode 100644
index 95387d46..00000000
--- a/modules/buildsystem/files/x86_64/media.cfg
+++ /dev/null
@@ -1,381 +0,0 @@
-[media_info]
-version=1
-mediacfg_version=2
-branch=Devel
-arch=x86_64
-xml-info=1
-
-[core/release]
-hdlist=hdlist_core_release.cz
-name=Core Release
-srpms=../../SRPMS/core/release
-media_type=official:free:release
-
-[debug/core/release]
-hdlist=hdlist_debug_core_release.cz
-name=Core Release Debug
-srpms=../../SRPMS/debug/core/release
-media_type=official:free:release:debug
-noauto=1
-
-[../../SRPMS/core/release]
-hdlist=hdlist_core_release.src.cz
-name=Core Release Sources
-rpms=core/release
-media_type=official:free:release:source
-noauto=1
-
-[core/updates]
-hdlist=hdlist_core_updates.cz
-name=Core Updates
-srpms=../../SRPMS/core/updates
-media_type=official:free:updates
-updates_for=core/release
-
-[debug/core/updates]
-hdlist=hdlist_debug_core_updates.cz
-name=Core Updates Debug
-srpms=../../SRPMS/debug/core/updates
-media_type=official:free:updates:debug
-noauto=1
-
-[../../SRPMS/core/updates]
-hdlist=hdlist_core_updates.src.cz
-name=Core Updates Sources
-rpms=core/updates
-media_type=official:free:updates:source
-noauto=1
-
-[core/updates_testing]
-hdlist=hdlist_core_updates_testing.cz
-name=Core Updates Testing
-srpms=../../SRPMS/core/updates_testing
-media_type=official:free:testing
-noauto=1
-
-[debug/core/updates_testing]
-hdlist=hdlist_debug_core_updates_testing.cz
-name=Core Updates Testing Debug
-srpms=../../SRPMS/debug/core/updates_testing
-media_type=official:free:testing:debug
-noauto=1
-
-[../../SRPMS/core/updates_testing]
-hdlist=hdlist_core_updates_testing.src.cz
-name=Core Updates Testing Sources
-rpms=core/updates_testing
-media_type=official:free:testing:source
-noauto=1
-
-[core/backports]
-hdlist=hdlist_core_backports.cz
-name=Core Backports
-srpms=../../SRPMS/core/backports
-media_type=official:free:backports
-noauto=1
-
-[debug/core/backports]
-hdlist=hdlist_debug_core_backports.cz
-name=Core Backports Debug
-srpms=../../SRPMS/debug/core/backports
-media_type=official:free:backports:debug
-noauto=1
-
-[../../SRPMS/core/backports]
-hdlist=hdlist_core_backports.src.cz
-name=Core Backports Sources
-rpms=core/backports
-media_type=official:free:backports:source
-noauto=1
-
-[core/backports_testing]
-hdlist=hdlist_core_backports_testing.cz
-name=Core Backports Testing
-srpms=../../SRPMS/core/backports_testing
-media_type=official:free:backports:testing
-noauto=1
-
-[debug/core/backports_testing]
-hdlist=hdlist_debug_core_backports_testing.cz
-name=Core Backports Testing Debug
-srpms=../../SRPMS/debug/core/backports_testing
-media_type=official:free:backports:testing:debug
-noauto=1
-
-[../../SRPMS/core/backports_testing]
-hdlist=hdlist_core_backports_testing.src.cz
-name=Core Backports Testing Sources
-rpms=core/backports_testing
-media_type=official:free:backports:testing:source
-noauto=1
-
-[nonfree/release]
-hdlist=hdlist_nonfree_release.cz
-name=Nonfree Release
-srpms=../../SRPMS/nonfree/release
-media_type=official:release
-noauto=1
-
-[debug/nonfree/release]
-hdlist=hdlist_debug_nonfree_release.cz
-name=Nonfree Release Debug
-srpms=../../SRPMS/debug/nonfree/release
-media_type=official:release:debug
-noauto=1
-
-[../../SRPMS/nonfree/release]
-hdlist=hdlist_nonfree_release.src.cz
-name=Nonfree Release Sources
-rpms=nonfree/release
-media_type=official:release:source
-noauto=1
-
-[nonfree/updates]
-hdlist=hdlist_nonfree_updates.cz
-name=Nonfree Updates
-srpms=../../SRPMS/nonfree/updates
-media_type=official:updates
-updates_for=nonfree/release
-noauto=1
-
-[debug/nonfree/updates]
-hdlist=hdlist_debug_nonfree_updates.cz
-name=Nonfree Updates Debug
-srpms=../../SRPMS/debug/nonfree/updates
-media_type=official:updates:debug
-noauto=1
-
-[../../SRPMS/nonfree/updates]
-hdlist=hdlist_nonfree_updates.src.cz
-name=Nonfree Updates Sources
-rpms=nonfree/updates
-media_type=official:updates:source
-noauto=1
-
-[nonfree/updates_testing]
-hdlist=hdlist_nonfree_updates_testing.cz
-name=Nonfree Updates Testing
-srpms=../../SRPMS/nonfree/updates_testing
-media_type=official:testing
-noauto=1
-
-[debug/nonfree/updates_testing]
-hdlist=hdlist_debug_nonfree_updates_testing.cz
-name=Nonfree Updates Testing Debug
-srpms=../../SRPMS/debug/nonfree/updates_testing
-media_type=official:testing:debug
-noauto=1
-
-[../../SRPMS/nonfree/updates_testing]
-hdlist=hdlist_nonfree_updates_testing.src.cz
-name=Nonfree Updates Testing Sources
-rpms=nonfree/updates_testing
-media_type=official:testing:source
-noauto=1
-
-[nonfree/backports]
-hdlist=hdlist_nonfree_backports.cz
-name=Nonfree Backports
-srpms=../../SRPMS/nonfree/backports
-media_type=official:backports
-noauto=1
-
-[debug/nonfree/backports]
-hdlist=hdlist_debug_nonfree_backports.cz
-name=Nonfree Backports Debug
-srpms=../../SRPMS/debug/nonfree/backports
-media_type=official:backports:debug
-noauto=1
-
-[../../SRPMS/nonfree/backports]
-hdlist=hdlist_nonfree_backports.src.cz
-name=Nonfree Backports Sources
-rpms=nonfree/backports
-media_type=official:backports:source
-noauto=1
-
-[nonfree/backports_testing]
-hdlist=hdlist_nonfree_backports_testing.cz
-name=Nonfree Backports Testing
-srpms=../../SRPMS/nonfree/backports_testing
-media_type=official:backports:testing
-noauto=1
-
-[debug/nonfree/backports_testing]
-hdlist=hdlist_debug_nonfree_backports_testing.cz
-name=Nonfree Backports Testing Debug
-srpms=../../SRPMS/debug/nonfree/backports_testing
-media_type=official:backports:testing:debug
-noauto=1
-
-[../../SRPMS/nonfree/backports_testing]
-hdlist=hdlist_nonfree_backports_testing.src.cz
-name=Nonfree Backports Testing Sources
-rpms=nonfree/backports_testing
-media_type=official:backports:testing:source
-noauto=1
-
-[tainted/release]
-hdlist=hdlist_tainted_release.cz
-name=Tainted Release
-srpms=../../SRPMS/tainted/release
-media_type=official:release
-noauto=1
-
-[debug/tainted/release]
-hdlist=hdlist_debug_tainted_release.cz
-name=Tainted Release Debug
-srpms=../../SRPMS/debug/tainted/release
-media_type=official:release:debug
-noauto=1
-
-[../../SRPMS/tainted/release]
-hdlist=hdlist_tainted_release.src.cz
-name=Tainted Release Sources
-rpms=tainted/release
-media_type=official:release:source
-noauto=1
-
-[tainted/updates]
-hdlist=hdlist_tainted_updates.cz
-name=Tainted Updates
-srpms=../../SRPMS/tainted/updates
-media_type=official:updates
-updates_for=tainted/release
-noauto=1
-
-[debug/tainted/updates]
-hdlist=hdlist_debug_tainted_updates.cz
-name=Tainted Updates Debug
-srpms=../../SRPMS/debug/tainted/updates
-media_type=official:updates:debug
-noauto=1
-
-[../../SRPMS/tainted/updates]
-hdlist=hdlist_tainted_updates.src.cz
-name=Tainted Updates Sources
-rpms=tainted/updates
-media_type=official:updates:source
-noauto=1
-
-[tainted/updates_testing]
-hdlist=hdlist_tainted_updates_testing.cz
-name=Tainted Updates Testing
-srpms=../../SRPMS/tainted/updates_testing
-media_type=official:testing
-noauto=1
-
-[debug/tainted/updates_testing]
-hdlist=hdlist_debug_tainted_updates_testing.cz
-name=Tainted Updates Testing Debug
-srpms=../../SRPMS/debug/tainted/updates_testing
-media_type=official:testing:debug
-noauto=1
-
-[../../SRPMS/tainted/updates_testing]
-hdlist=hdlist_tainted_updates_testing.src.cz
-name=Tainted Updates Testing Sources
-rpms=tainted/updates_testing
-media_type=official:testing:source
-noauto=1
-
-[tainted/backports]
-hdlist=hdlist_tainted_backports.cz
-name=Tainted Backports
-srpms=../../SRPMS/tainted/backports
-media_type=official:backports
-noauto=1
-
-[debug/tainted/backports]
-hdlist=hdlist_debug_tainted_backports.cz
-name=Tainted Backports Debug
-srpms=../../SRPMS/debug/tainted/backports
-media_type=official:backports:debug
-noauto=1
-
-[../../SRPMS/tainted/backports]
-hdlist=hdlist_tainted_backports.src.cz
-name=Tainted Backports Sources
-rpms=tainted/backports
-media_type=official:backports:source
-noauto=1
-
-[tainted/backports_testing]
-hdlist=hdlist_tainted_backports_testing.cz
-name=Tainted Backports Testing
-srpms=../../SRPMS/tainted/backports_testing
-media_type=official:backports:testing
-noauto=1
-
-[debug/tainted/backports_testing]
-hdlist=hdlist_debug_tainted_backports_testing.cz
-name=Tainted Backports Testing Debug
-srpms=../../SRPMS/debug/tainted/backports_testing
-media_type=official:backports:testing:debug
-noauto=1
-
-[../../SRPMS/tainted/backports_testing]
-hdlist=hdlist_tainted_backports_testing.src.cz
-name=Tainted Backports Testing Sources
-rpms=tainted/backports_testing
-media_type=official:backports:testing:source
-noauto=1
-
-[../../i586/media/core/release]
-hdlist=hdlist_core32_release.cz
-name=Core 32bit Release
-media_type=official:free:release
-
-[../../i586/media/debug/core/release]
-hdlist=hdlist_debug_core32_release.cz
-name=Core 32bit Release Debug
-media_type=official:free:release:debug
-noauto=1
-
-[../../i586/media/core/updates]
-hdlist=hdlist_core32_updates.cz
-name=Core 32bit Updates
-media_type=official:free:updates
-updates_for=../../i586/media/core/release
-
-[../../i586/media/debug/core/updates]
-hdlist=hdlist_debug_core32_updates.cz
-name=Core 32bit Updates Debug
-media_type=official:free:updates:debug
-noauto=1
-
-[../../i586/media/core/updates_testing]
-hdlist=hdlist_core32_updates_testing.cz
-name=Core 32bit Updates Testing
-media_type=official:free:testing
-noauto=1
-
-[../../i586/media/debug/core/updates_testing]
-hdlist=hdlist_debug_core32_updates_testing.cz
-name=Core 32bit Updates Testing Debug
-media_type=official:free:testing:debug
-noauto=1
-
-[../../i586/media/core/backports]
-hdlist=hdlist_core32_backports.cz
-name=Core 32bit Backports
-media_type=official:free:backports
-noauto=1
-
-[../../i586/media/debug/core/backports]
-hdlist=hdlist_debug_core32_backports.cz
-name=Core 32bit Backports Debug
-media_type=official:free:backports:debug
-noauto=1
-
-[../../i586/media/core/backports_testing]
-hdlist=hdlist_core32_backports_testing.cz
-name=Core 32bit Backports Testing
-media_type=official:free:backports:testing
-noauto=1
-
-[../../i586/media/debug/core/backports_testing]
-hdlist=hdlist_debug_core32_backports_testing.cz
-name=Core 32bit Backports Testing Debug
-media_type=official:free:backports:testing:debug
-noauto=1
diff --git a/modules/buildsystem/lib/puppet/parser/functions/group_members.rb b/modules/buildsystem/lib/puppet/parser/functions/group_members.rb
deleted file mode 100644
index c5cecbe8..00000000
--- a/modules/buildsystem/lib/puppet/parser/functions/group_members.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-require 'etc'
-# group_members($group)
-# -> return a array with the login of the group members
-
-module Puppet::Parser::Functions
- newfunction(:group_members, :type => :rvalue) do |args|
- group = args[0]
- return Etc.getgrnam(group).mem
- end
-end
diff --git a/modules/buildsystem/manifests/base.pp b/modules/buildsystem/manifests/base.pp
deleted file mode 100644
index 0838da90..00000000
--- a/modules/buildsystem/manifests/base.pp
+++ /dev/null
@@ -1,21 +0,0 @@
-class buildsystem::base {
-
- $sched_login = 'schedbot'
- $sched_home_dir = "/var/lib/$sched_login"
-
- $repository_root = '/distrib/bootstrap'
-
- $packagers_group = 'mga-packagers'
- $packagers_committers_group = 'mga-packagers-committers'
-
- include ssh::auth
- ssh::auth::key { $buildsystem::iurt::user::login:
- # declare a key for build bot: RSA, 2048 bits
- home => $buildsystem::iurt::user::homedir,
- }
-
- ssh::auth::key { $sched_login:
- # declare a key for sched bot: RSA, 2048 bits
- home => $sched_home_dir,
- }
-}
diff --git a/modules/buildsystem/manifests/binrepo.pp b/modules/buildsystem/manifests/binrepo.pp
index ca3a7e55..5bf16b53 100644
--- a/modules/buildsystem/manifests/binrepo.pp
+++ b/modules/buildsystem/manifests/binrepo.pp
@@ -1,42 +1,48 @@
class buildsystem::binrepo {
- include buildsystem::base
- include sudo
- $login = 'binrepo'
- $homedir = "/var/lib/$login"
- $repodir = "$homedir/data"
+ include buildsystem::var::binrepo
+ include buildsystem::var::groups
+ include sudo
- $uploadinfosdir = "$homedir/infos"
- $uploadbinpath = '/usr/local/bin/upload-bin'
- $uploadmail_from = "root@$::domain"
- $uploadmail_to = "packages-commits@ml.$::domain"
+ # upload-bin script uses the mailx command provided by nail
+if versioncmp($::lsbdistrelease, '9') < 0 {
+ package { 'nail':
+ ensure => installed,
+ }
+} else {
+ package { 's-nail':
+ ensure => installed,
+ }
+}
- # used in templates
- $packagers_committers_group = $buildsystem::base::packagers_committers_group
+ user { $buildsystem::var::binrepo::login:
+ home => $buildsystem::var::binrepo::homedir,
+ }
- user { $login:
- comment => 'Binary files repository',
- home => $homedir,
- }
+ file { [$buildsystem::var::binrepo::repodir, $buildsystem::var::binrepo::uploadinfosdir]:
+ ensure => directory,
+ owner => $buildsystem::var::binrepo::login,
+ }
- file { [$repodir, $uploadinfosdir]:
- ensure => directory,
- owner => $login,
- }
+ mga_common::local_script {
+ 'upload-bin':
+ content => template('buildsystem/binrepo/upload-bin');
+ 'wrapper.upload-bin':
+ content => template('buildsystem/binrepo/wrapper.upload-bin');
+ }
- local_script {
- 'upload-bin':
- content => template('buildsystem/binrepo/upload-bin');
- 'wrapper.upload-bin':
- content => template('buildsystem/binrepo/wrapper.upload-bin');
- }
+ sudo::sudoers_config { 'binrepo':
+ content => template('buildsystem/binrepo/sudoers.binrepo')
+ }
- sudo::sudoers_config { 'binrepo':
- content => template('buildsystem/binrepo/sudoers.binrepo')
- }
+ apache::vhost::base { $buildsystem::var::binrepo::hostname:
+ location => $buildsystem::var::binrepo::repodir,
+ content => template('buildsystem/binrepo/vhost_binrepo.conf'),
+ }
- apache::vhost_base { "binrepo.$::domain":
- location => $repodir,
- content => template('buildsystem/binrepo/vhost_binrepo.conf'),
- }
+ apache::vhost::base { "ssl_${buildsystem::var::binrepo::hostname}":
+ use_ssl => true,
+ vhost => $buildsystem::var::binrepo::hostname,
+ location => $buildsystem::var::binrepo::repodir,
+ content => template('buildsystem/binrepo/vhost_binrepo.conf'),
}
}
diff --git a/modules/buildsystem/manifests/buildnode.pp b/modules/buildsystem/manifests/buildnode.pp
index f2efa8a3..1573c093 100644
--- a/modules/buildsystem/manifests/buildnode.pp
+++ b/modules/buildsystem/manifests/buildnode.pp
@@ -1,4 +1,12 @@
class buildsystem::buildnode {
- include buildsystem::base
include buildsystem::iurt
+ include buildsystem::var::scheduler
+ include buildsystem::var::iurt
+ include buildsystem::sshkeys
+
+ sshkeys::set_authorized_keys { 'iurt-allow-scheduler':
+ keyname => $buildsystem::var::scheduler::login,
+ home => $buildsystem::var::iurt::homedir,
+ user => $buildsystem::var::iurt::login,
+ }
}
diff --git a/modules/buildsystem/manifests/create_upload_dir.rb b/modules/buildsystem/manifests/create_upload_dir.rb
index dd30d00d..8023ab5d 100644
--- a/modules/buildsystem/manifests/create_upload_dir.rb
+++ b/modules/buildsystem/manifests/create_upload_dir.rb
@@ -1,22 +1,25 @@
-define "create_upload_dir", :owner, :group, :releases do
+hostclass "buildsystem::create_upload_dir" do
states = ["todo","done","failure","queue","rejected"]
+ owner = scope.lookupvar('buildsystem::var::scheduler::login')
+ group = owner
+ uploads_dir = scope.lookupvar('buildsystem::var::scheduler::homedir') + '/uploads'
- file @name, :ensure => 'directory', :owner => @owner, :group => @group
+ file uploads_dir, :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
+ file [uploads_dir, st].join('/'), :ensure => 'directory', :owner => owner, :group => group
+
+ 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, m|
+ file [uploads_dir, st, rel, media].join('/'), :ensure => 'directory', :owner => owner, :group => group
+
+ for repo in m['repos'].keys do
if st == 'done'
- file [@name, 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 [@name, 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/distros.rb b/modules/buildsystem/manifests/distros.rb
new file mode 100644
index 00000000..a298c0a8
--- /dev/null
+++ b/modules/buildsystem/manifests/distros.rb
@@ -0,0 +1,97 @@
+hostclass "buildsystem::distros" do
+ mirror_user = 'root'
+ schedbot_user = scope.lookupvar('buildsystem::var::scheduler::login')
+ bootstrap_reporoot = scope.lookupvar('buildsystem::var::repository::bootstrap_reporoot')
+ scope.lookupvar('buildsystem::var::distros::distros').each{|rel, distro|
+ file [ bootstrap_reporoot, rel ].join('/'), :ensure => 'directory',
+ :owner => mirror_user, :group => mirror_user
+ for arch in distro['arch'] do
+ # As ruby dsl cannot use defined resources, we have to use a
+ # workaround with 'find_resource_type' as described in this
+ # puppet issue: http://projects.puppetlabs.com/issues/11912
+ scope.find_resource_type 'buildsystem::media_cfg'
+ media_cfg_args = {
+ :distro_name => rel,
+ :arch => arch,
+ }
+ if distro['tmpl_media.cfg'] != nil
+ media_cfg_args['templatefile'] = distro['tmpl_media.cfg']
+ end
+ if ! distro['no_media_cfg_update']
+ create_resource 'buildsystem::media_cfg',
+ [ rel, ' ', arch ].join('/'), media_cfg_args
+ end
+ file [ bootstrap_reporoot, rel, arch ].join('/'),
+ :ensure => 'directory', :owner => schedbot_user,
+ :group => schedbot_user
+ mediadir = [ bootstrap_reporoot, rel, arch, 'media' ].join('/')
+ file mediadir, :ensure => 'directory', :owner => schedbot_user,
+ :group => schedbot_user
+ file [ mediadir, 'media_info' ].join('/'), :ensure => 'directory',
+ :owner => schedbot_user, :group => schedbot_user
+ file [ mediadir, 'debug' ].join('/'), :ensure => 'directory',
+ :owner => schedbot_user, :group => schedbot_user
+ distro['medias'].each{|media, m|
+ file [ mediadir, media ].join('/'), :ensure => 'directory',
+ :owner => schedbot_user, :group => schedbot_user
+ file [ mediadir, 'debug', media ].join('/'),
+ :ensure => 'directory', :owner => schedbot_user,
+ :group => schedbot_user
+ for repo in m['repos'].keys do
+ file [ mediadir, media, repo ].join('/'),
+ :ensure => 'directory', :owner => schedbot_user,
+ :group => schedbot_user
+ file [ mediadir, media, repo, 'media_info' ].join('/'),
+ :ensure => 'directory', :owner => schedbot_user,
+ :group => schedbot_user
+ file [ mediadir, media, repo, 'repodata' ].join('/'),
+ :ensure => 'directory', :owner => schedbot_user,
+ :group => schedbot_user
+ file [ mediadir, 'debug', media, repo ].join('/'),
+ :ensure => 'directory', :owner => schedbot_user,
+ :group => schedbot_user
+ file [ mediadir, 'debug', media, repo, 'media_info' ].join('/'),
+ :ensure => 'directory', :owner => schedbot_user,
+ :group => schedbot_user
+ file [ mediadir, 'debug', media, repo, 'repodata' ].join('/'),
+ :ensure => 'directory', :owner => schedbot_user,
+ :group => schedbot_user
+ end
+ }
+ if distro['based_on'] != nil
+ distro['based_on'].each{|bdistroname, medias|
+ file [ mediadir, bdistroname ].join('/'),
+ :ensure => 'directory', :owner => mirror_user,
+ :group => mirror_user
+ medias.each{|medianame, media|
+ mdir = [ mediadir, bdistroname, medianame ].join('/')
+ file mdir, :ensure => 'directory',
+ :owner => mirror_user, :group => mirror_user
+ for reponame in media
+ file [ mdir, reponame ].join('/'),
+ :ensure => 'link',
+ :target => [
+ '../../../../..', bdistroname, arch,
+ 'media', medianame, reponame ].join('/'),
+ :owner => mirror_user, :group => mirror_user
+ end
+ }
+ }
+ end
+ end
+ # SRPMS
+ srpmsdir = [ bootstrap_reporoot, rel, 'SRPMS' ].join('/')
+ file srpmsdir,
+ :ensure => 'directory', :owner => schedbot_user,
+ :group => schedbot_user
+ distro['medias'].each{|media, m|
+ file [ srpmsdir, media ].join('/'), :ensure => 'directory',
+ :owner => schedbot_user, :group => schedbot_user
+ for repo in m['repos'].keys do
+ file [ srpmsdir, media, repo ].join('/'),
+ :ensure => 'directory', :owner => schedbot_user,
+ :group => schedbot_user
+ end
+ }
+ }
+end
diff --git a/modules/buildsystem/manifests/gatherer.pp b/modules/buildsystem/manifests/gatherer.pp
index e0a18222..eebfd97e 100644
--- a/modules/buildsystem/manifests/gatherer.pp
+++ b/modules/buildsystem/manifests/gatherer.pp
@@ -1,5 +1,5 @@
class buildsystem::gatherer {
# emi is in main iurt rpm, should be moved out
- include iurt::package
+ include iurt::packages
include iurt::upload
}
diff --git a/modules/buildsystem/manifests/init.pp b/modules/buildsystem/manifests/init.pp
index af88d4ef..f15b5dbf 100644
--- a/modules/buildsystem/manifests/init.pp
+++ b/modules/buildsystem/manifests/init.pp
@@ -1,18 +1,2 @@
class buildsystem {
- # A script to copy on valstar the 2010.1 rpms built on jonund
- class sync20101 inherits base {
- $build_login = $buildsystem::iurt::user::login
- # TODO user iurt::user::homedir too
- local_script { "sync2010.1":
- content => template("buildsystem/sync2010.1"),
- }
- }
-
- # a script to build 2010.1 packages. used on jonund
- class iurt20101 inherits base {
- $build_login = $buildsystem::iurt::user::login
- local_script { "iurt2010.1":
- content => template("buildsystem/iurt2010.1"),
- }
- }
}
diff --git a/modules/buildsystem/manifests/iurt.pp b/modules/buildsystem/manifests/iurt.pp
new file mode 100644
index 00000000..231c5373
--- /dev/null
+++ b/modules/buildsystem/manifests/iurt.pp
@@ -0,0 +1,26 @@
+class buildsystem::iurt {
+ include sudo
+ include buildsystem::iurt::user
+ include buildsystem::iurt::packages
+ include buildsystem::var::iurt
+ include buildsystem::var::distros
+
+ # remove old build directory
+ tidy { "${buildsystem::var::iurt::homedir}/iurt":
+ age => '8w',
+ recurse => true,
+ matches => ['[0-9][0-9].*\..*\..*\.[0-9]*','log','*.rpm','*.log','*.mga[0-9]+'],
+ rmdirs => true,
+ }
+
+ file { '/etc/iurt/build':
+ ensure => directory,
+ }
+
+ $distros_list = hash_keys($buildsystem::var::distros::distros)
+ buildsystem::iurt::config { $distros_list: }
+
+ sudo::sudoers_config { 'iurt':
+ content => template('buildsystem/sudoers.iurt')
+ }
+}
diff --git a/modules/buildsystem/manifests/iurt/config.pp b/modules/buildsystem/manifests/iurt/config.pp
index 88c08b66..02f5be63 100644
--- a/modules/buildsystem/manifests/iurt/config.pp
+++ b/modules/buildsystem/manifests/iurt/config.pp
@@ -1,11 +1,50 @@
define buildsystem::iurt::config() {
+ include buildsystem::var::iurt
+ include buildsystem::var::webstatus
+ include buildsystem::var::repository
$distribution = $name
# TODO rename the variable too in template
- $build_login = $buildsystem::iurt::user::login
+ $build_login = $buildsystem::var::iurt::login
- file { "/etc/iurt/build/$distribution.conf":
+ $build_timeout = {
+ 'default' => 36000,
+ 'atlas' => 57600,
+ 'blender' => 57600,
+ 'chromium-browser-stable' => 172800,
+ 'clang' => 172800,
+ 'cross-gcc' => 115200,
+ 'gcc' => 115200,
+ 'itk' => 115200,
+ 'java-1.8.0-openjdk' => 172800,
+ 'java-17-openjdk' => 172800,
+ 'java-21-openjdk' => 172800,
+ 'java-latest-openjdk' => 172800,
+ 'kernel' => 115200,
+ 'libreoffice' => 432000,
+ 'llvm' => 115200,
+ 'llvm17-suite' => 115200,
+ 'llvm19-suite' => 115200,
+ 'openfoam' => 115200,
+ 'paraview' => 115200,
+ 'qgis' => 57600,
+ 'qtwebengine5' => 115200,
+ 'qtwebengine6' => 172800,
+ 'rust' => 180000,
+ 'salome' => 57600,
+ 'vtk' => 57600,
+ 'webkit' => 57600,
+ 'webkit2' => 115200,
+ 'wrapitk' => 115200,
+ 'rocm-llvm' => 70000,
+ }
+
+ $allow_network_access = [
+ 'libguestfs', # Needs access to the configured mirrors
+ ]
+
+ file { "/etc/iurt/build/${distribution}.conf":
owner => $build_login,
group => $build_login,
- content => template("buildsystem/iurt/$distribution.conf")
+ content => template("buildsystem/iurt.conf")
}
}
diff --git a/modules/buildsystem/manifests/iurt/init.pp b/modules/buildsystem/manifests/iurt/init.pp
deleted file mode 100644
index 9f5780bd..00000000
--- a/modules/buildsystem/manifests/iurt/init.pp
+++ /dev/null
@@ -1,31 +0,0 @@
-class buildsystem::iurt {
- include sudo
- include buildsystem::iurt::user
- include buildsystem::iurt::package
- $login = $buildsystem::iurt::user::login
- $homedir = $buildsystem::iurt::user::homedir
-
- ssh::auth::client { $login: }
-
- ssh::auth::server { $buildsystem::base::sched_login:
- user => $login
- }
-
- # remove old build directory
- tidy { "$homedir/iurt":
- age => '8w',
- recurse => true,
- matches => ['[0-9][0-9].*\..*\..*\.[0-9]*','log','*.rpm','*.log','*.mga[0-9]+'],
- rmdirs => true,
- }
-
- file { '/etc/iurt/build':
- ensure => directory,
- }
-
- buildsystem::iurt::config { ['1','cauldron','mandriva2010.1','infra_1']: }
-
- sudo::sudoers_config { 'iurt':
- content => template('buildsystem/iurt/sudoers.iurt')
- }
-}
diff --git a/modules/buildsystem/manifests/iurt/packages.pp b/modules/buildsystem/manifests/iurt/packages.pp
index 448b4a89..e814b7c2 100644
--- a/modules/buildsystem/manifests/iurt/packages.pp
+++ b/modules/buildsystem/manifests/iurt/packages.pp
@@ -1,3 +1,3 @@
class buildsystem::iurt::packages {
package { 'iurt': }
-}
+}
diff --git a/modules/buildsystem/manifests/iurt/upload.pp b/modules/buildsystem/manifests/iurt/upload.pp
index e971e338..5417d36e 100644
--- a/modules/buildsystem/manifests/iurt/upload.pp
+++ b/modules/buildsystem/manifests/iurt/upload.pp
@@ -1,7 +1,7 @@
class buildsystem::iurt::upload {
- $login = $buildsystem::iurt::user::login
- $homedir = $buildsystem::iurt::user::homedir
-
+ include buildsystem::var::iurt
+ include buildsystem::var::webstatus
+ include buildsystem::var::repository
file { '/etc/iurt/upload.conf':
require => File['/etc/iurt'],
content => template('buildsystem/upload.conf'),
@@ -10,7 +10,7 @@ class buildsystem::iurt::upload {
exec { 'check iurt config':
refreshonly => true,
- cmd => 'perl -cw /etc/iurt/upload.conf',
+ command => 'perl -cw /etc/iurt/upload.conf',
logoutput => 'on_failure',
}
}
diff --git a/modules/buildsystem/manifests/iurt/user.pp b/modules/buildsystem/manifests/iurt/user.pp
index a70c25c1..a93ac7e7 100644
--- a/modules/buildsystem/manifests/iurt/user.pp
+++ b/modules/buildsystem/manifests/iurt/user.pp
@@ -1,10 +1,8 @@
class buildsystem::iurt::user {
- $login = 'iurt'
- $homedir = "/home/$login"
+ include buildsystem::var::iurt
- sshuser { $login:
- homedir => $homedir,
- comment => 'System user used to run build bots',
+ buildsystem::sshuser { $buildsystem::var::iurt::login:
+ homedir => $buildsystem::var::iurt::homedir,
}
file { '/etc/iurt':
diff --git a/modules/buildsystem/manifests/mainnode.pp b/modules/buildsystem/manifests/mainnode.pp
index 26755d96..01de764f 100644
--- a/modules/buildsystem/manifests/mainnode.pp
+++ b/modules/buildsystem/manifests/mainnode.pp
@@ -1,55 +1,23 @@
class buildsystem::mainnode {
- include buildsystem::base
+ include buildsystem::var::repository
+ include buildsystem::var::scheduler
+ include buildsystem::var::distros
include buildsystem::iurt::user
include buildsystem::scheduler
include buildsystem::gatherer
include buildsystem::mgarepo
include buildsystem::signbot
include buildsystem::youri_submit
+ include buildsystem::sshkeys
+ include buildsystem::distros
- $sched_login = $buildsystem::base::sched_login
- $sched_home_dir = $buildsystem::base::sched_home_dir
- $build_login = $buildsystem::iurt::user::login
- $repository_root = $buildsystem::base::repository_root
-
- sshuser { $sched_login:
- homedir => $sched_home_dir,
- comment => 'System user used to schedule builds',
- }
-
- ssh::auth::client { $sched_login: }
-
- ssh::auth::server { [$sched_login, $build_login]: }
-
- $mirror_root = '/distrib/mirror'
- apache::vhost_other_app { "repository.$::domain":
- vhost_file => 'buildsystem/vhost_repository.conf',
- }
-
- $location = '/var/www/bs'
- file { [$location,"$location/data"]:
- ensure => directory,
+ sshkeys::set_client_key_pair { $buildsystem::var::scheduler::login:
+ home => $buildsystem::var::scheduler::homedir,
+ user => $buildsystem::var::scheduler::login,
}
-
- apache::vhost_base { "pkgsubmit.$::domain":
- aliases => { '/uploads' => "$sched_home_dir/uploads" },
- location => $location,
- content => template('buildsystem/vhost_pkgsubmit.conf'),
- }
-
- subversion::snapshot { $location:
- source => "svn://svn.$::domain/soft/buildsystem/web/",
- }
-
- file { $repository_root:
- ensure => directory,
- }
-
- buildsystem::media_cfg { ['i586','x86_64']: }
-
- cron { 'dispatch jobs':
- user => $sched_login,
- command => 'ulri; emi',
- minute => '*',
+ sshkeys::set_authorized_keys { 'scheduler-allow-scheduler':
+ keyname => $buildsystem::var::scheduler::login,
+ home => $buildsystem::var::scheduler::homedir,
+ user => $buildsystem::var::scheduler::login,
}
}
diff --git a/modules/buildsystem/manifests/maintdb.pp b/modules/buildsystem/manifests/maintdb.pp
index 156821e1..5a961b63 100644
--- a/modules/buildsystem/manifests/maintdb.pp
+++ b/modules/buildsystem/manifests/maintdb.pp
@@ -1,31 +1,27 @@
class buildsystem::maintdb {
+ include buildsystem::var::maintdb
+ include buildsystem::var::groups
+ include buildsystem::var::webstatus
include sudo
- $login = 'maintdb'
- $homedir = '/var/lib/maintdb'
- $dbdir = "$homedir/db"
- $binpath = '/usr/local/sbin/maintdb'
- $dump = '/var/www/bs/data/maintdb.txt'
- $unmaintained = '/var/www/bs/data/unmaintained.txt'
- user { $login:
- comment => 'Maintainers database',
- home => $homedir,
+ user { $buildsystem::var::maintdb::login:
+ home => $buildsystem::var::maintdb::homedir,
}
- file { [$homedir,$dbdir]:
+ file { [$buildsystem::var::maintdb::homedir,$buildsystem::var::maintdb::dbdir]:
ensure => directory,
- owner => $login,
- group => $login,
+ owner => $buildsystem::var::maintdb::login,
+ group => $buildsystem::var::maintdb::login,
mode => '0711',
- require => User[$login],
+ require => User[$buildsystem::var::maintdb::login],
}
- file { $binpath:
+ file { $buildsystem::var::maintdb::binpath:
mode => '0755',
content => template('buildsystem/maintdb/maintdb.bin')
}
- local_script { 'wrapper.maintdb':
+ mga_common::local_script { 'wrapper.maintdb':
content => template('buildsystem/maintdb/wrapper.maintdb')
}
@@ -33,21 +29,30 @@ class buildsystem::maintdb {
content => template('buildsystem/maintdb/sudoers.maintdb')
}
- file { [$dump,"$dump.new",
- $unmaintained,"$unmaintained.new"]:
- owner => $login,
- require => File['/var/www/bs/data'],
+ file { [$buildsystem::var::maintdb::dump,
+ "${buildsystem::var::maintdb::dump}.new",
+ $buildsystem::var::maintdb::unmaintained,
+ "${buildsystem::var::maintdb::unmaintained}.new"]:
+ owner => $buildsystem::var::maintdb::login,
+ require => File["${buildsystem::var::webstatus::location}/data"],
}
cron { 'update maintdb export':
- user => $login,
- command => "$binpath root get > $dump.new; cp -f $dump.new $dump; grep ' nobody\$' $dump | sed 's/ nobody\$//' > $unmaintained.new; cp -f $unmaintained.new $unmaintained",
+ user => $buildsystem::var::maintdb::login,
+ command => "${buildsystem::var::maintdb::binpath} root get > ${buildsystem::var::maintdb::dump}.new; cp -f ${buildsystem::var::maintdb::dump}.new ${buildsystem::var::maintdb::dump}; grep ' nobody\$' ${buildsystem::var::maintdb::dump} | sed 's/ nobody\$//' > ${buildsystem::var::maintdb::unmaintained}.new; cp -f ${buildsystem::var::maintdb::unmaintained}.new ${buildsystem::var::maintdb::unmaintained}",
minute => '*/30',
- require => User[$login],
+ require => User[$buildsystem::var::maintdb::login],
}
- apache::vhost_base { "maintdb.$::domain":
- location => $dbdir,
+ apache::vhost::base { $buildsystem::var::maintdb::hostname:
+ location => $buildsystem::var::maintdb::dbdir,
+ content => template('buildsystem/maintdb/vhost_maintdb.conf'),
+ }
+
+ apache::vhost::base { "ssl_${buildsystem::var::maintdb::hostname}":
+ use_ssl => true,
+ vhost => $buildsystem::var::maintdb::hostname,
+ location => $buildsystem::var::maintdb::dbdir,
content => template('buildsystem/maintdb/vhost_maintdb.conf'),
}
}
diff --git a/modules/buildsystem/manifests/media_cfg.pp b/modules/buildsystem/manifests/media_cfg.pp
index 9f7b6870..77fcc8fd 100644
--- a/modules/buildsystem/manifests/media_cfg.pp
+++ b/modules/buildsystem/manifests/media_cfg.pp
@@ -1,10 +1,11 @@
-define buildsystem::media_cfg() {
- $arch = $name
- file { "$buildsystem::base::repository_root/distrib/cauldron/$arch/media/media_info/media.cfg":
- owner => $buildsystem::base::sched_login,
- group => $buildsystem::base::sched_login,
- source => "puppet:///modules/buildsystem/$arch/media.cfg",
+define buildsystem::media_cfg($distro_name, $arch, $templatefile = 'buildsystem/media.cfg') {
+ include buildsystem::var::repository
+ include buildsystem::var::scheduler
+ include buildsystem::repository
+
+ file { "${buildsystem::var::repository::bootstrap_reporoot}/${distro_name}/${arch}/media/media_info/media.cfg":
+ owner => $buildsystem::var::scheduler::login,
+ group => $buildsystem::var::scheduler::login,
+ content => template($templatefile),
}
}
-
-
diff --git a/modules/buildsystem/manifests/mgacreatehome.pp b/modules/buildsystem/manifests/mgacreatehome.pp
deleted file mode 100644
index d7a05527..00000000
--- a/modules/buildsystem/manifests/mgacreatehome.pp
+++ /dev/null
@@ -1,7 +0,0 @@
-class buildsystem::mgacreatehome {
- # temporary script to create home dir with ssh key
- # taking login and url as arguments
- local_script { 'mgacreatehome':
- content => template('buildsystem/mgacreatehome')
- }
-}
diff --git a/modules/buildsystem/manifests/mgarepo.pp b/modules/buildsystem/manifests/mgarepo.pp
index 0866c70c..14e11e1a 100644
--- a/modules/buildsystem/manifests/mgarepo.pp
+++ b/modules/buildsystem/manifests/mgarepo.pp
@@ -1,63 +1,36 @@
class buildsystem::mgarepo {
- $sched_home_dir = $buildsystem::base::sched_home_dir
- $sched_login = $buildsystem::base::sched_login
+ include buildsystem::var::scheduler
+ include buildsystem::var::distros
+ 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
package { ['mgarepo','rpm-build']: }
- file {
- '/etc/mgarepo.conf': content => template('buildsystem/mgarepo.conf');
- '/etc/repsys.conf': content => template('buildsystem/mgarepo.conf');
+ file { '/etc/mgarepo.conf':
+ content => template('buildsystem/mgarepo.conf'),
}
- file { "$sched_home_dir/repsys":
+ file { "${sched_home_dir}/repsys":
ensure => 'directory',
owner => $sched_login,
require => File[$sched_home_dir],
}
- file { ["$sched_home_dir/repsys/tmp", "$sched_home_dir/repsys/srpms"]:
+ file { ["${sched_home_dir}/repsys/tmp", "${sched_home_dir}/repsys/srpms"]:
ensure => 'directory',
owner => $sched_login,
- group => 'mga-packagers',
+ group => $buildsystem::var::groups::packagers,
mode => '1775',
- require => File["$sched_home_dir/repsys"],
+ require => File["${sched_home_dir}/repsys"],
}
- # FIXME: disabled temporarly as upload dir is a symlink to /var/lib/repsys/uploads
- #file { "$sched_home_dir/uploads":
+ # FIXME: disabled temporarily as upload dir is a symlink to /var/lib/repsys/uploads
+ #file { "${sched_home_dir}/uploads":
# ensure => "directory",
# owner => $sched_login,
# 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'],
- },
- 'infra_1' => {
- 'infra' => ['release']
- },
- }
-
- import 'create_upload_dir.rb'
- create_upload_dir { "$sched_home_dir/uploads":
- owner => $sched_login,
- group => $sched_login,
- releases => $releases,
- }
-
- tidy { "$sched_home_dir/uploads":
- type => 'ctime',
- recurse => true,
- age => '2w',
- }
-
}
diff --git a/modules/buildsystem/manifests/release.pp b/modules/buildsystem/manifests/release.pp
index 1682d71b..d9feac8e 100644
--- a/modules/buildsystem/manifests/release.pp
+++ b/modules/buildsystem/manifests/release.pp
@@ -1,7 +1,5 @@
class buildsystem::release {
- subversion::snapshot { '/root/release':
- source => "svn://svn.$::domain/soft/release/trunk/",
+ git::snapshot { '/root/release':
+ source => "git://git.${::domain}/software/infrastructure/release",
}
-
- package { 'hardlink': }
}
diff --git a/modules/buildsystem/manifests/repoctl.pp b/modules/buildsystem/manifests/repoctl.pp
new file mode 100644
index 00000000..8d44e52c
--- /dev/null
+++ b/modules/buildsystem/manifests/repoctl.pp
@@ -0,0 +1,11 @@
+class buildsystem::repoctl {
+ include buildsystem::var::distros
+ include buildsystem::var::repository
+
+ package{ 'repoctl': }
+
+ file { '/etc/repoctl.conf':
+ content => template('buildsystem/repoctl.conf'),
+ require => Package['repoctl'],
+ }
+}
diff --git a/modules/buildsystem/manifests/repository.pp b/modules/buildsystem/manifests/repository.pp
new file mode 100644
index 00000000..dda90eb2
--- /dev/null
+++ b/modules/buildsystem/manifests/repository.pp
@@ -0,0 +1,11 @@
+class buildsystem::repository {
+ include buildsystem::var::repository
+ file { [ $buildsystem::var::repository::bootstrap_root,
+ $buildsystem::var::repository::bootstrap_reporoot ] :
+ ensure => directory,
+ }
+
+ apache::vhost::other_app { $buildsystem::var::repository::hostname:
+ vhost_file => 'buildsystem/vhost_repository.conf',
+ }
+}
diff --git a/modules/buildsystem/manifests/rpmlint.pp b/modules/buildsystem/manifests/rpmlint.pp
index ea9a55b8..388d0bee 100644
--- a/modules/buildsystem/manifests/rpmlint.pp
+++ b/modules/buildsystem/manifests/rpmlint.pp
@@ -1,19 +1,3 @@
class buildsystem::rpmlint {
- $sched_login = $buildsystem::base::sched_login
-
package { 'rpmlint': }
-
- file { '/etc/rpmlint/config':
- require => Package['rpmlint'],
- content => template('buildsystem/rpmlint.conf')
- }
-
- # directory that hold configuration auto extracted after upload
- # of the rpmlint policy
- # should belong to the scheduler user, as it need to write to it
- file { '/etc/rpmlint/extracted.d/':
- ensure => directory,
- require => Package['rpmlint'],
- owner => $sched_login,
- }
}
diff --git a/modules/buildsystem/manifests/scheduler.pp b/modules/buildsystem/manifests/scheduler.pp
index 1b3d32d5..53b248fc 100644
--- a/modules/buildsystem/manifests/scheduler.pp
+++ b/modules/buildsystem/manifests/scheduler.pp
@@ -1,5 +1,57 @@
class buildsystem::scheduler {
- # until ulri is splitted from main iurt rpm
- include iurt::package
- include iurt::upload
+ # until ulri is split from main iurt rpm
+ include buildsystem::iurt::packages
+ include buildsystem::iurt::upload
+ include buildsystem::var::scheduler
+
+ $login = $buildsystem::var::scheduler::login
+ $homedir = $buildsystem::var::scheduler::homedir
+ $logdir = $buildsystem::var::scheduler::logdir
+
+ buildsystem::sshuser { $login:
+ homedir => $homedir,
+ }
+
+ file { $logdir:
+ ensure => directory,
+ mode => '0755',
+ owner => $login,
+ }
+
+ cron { 'dispatch jobs':
+ user => $login,
+ command => "EMI_LOG_FILE=${logdir}/emi.log ULRI_LOG_FILE=${logdir}/ulri.log ulri; EMI_LOG_FILE=${logdir}/emi.log emi",
+ minute => '*',
+ }
+
+ if ($buildsystem::var::scheduler::clean_uploads_logs_age != 0) {
+ cron { 'clean uploads logs':
+ user => $login,
+ # Delete old upload logs
+ command => sprintf("/usr/bin/find %s/uploads -ignore_readdir_race -xdev -depth -type f -ctime +%d -delete", shellquote($homedir), shellquote($buildsystem::var::scheduler::clean_uploads_logs_age)),
+ hour => '*/4',
+ minute => '51',
+ }
+ cron { 'clean uploads dirs':
+ user => $login,
+ # Remove old empty uploads directories. This will take several
+ # passes (over several weeks) to delete a directory hierarchy
+ # because it is looking at ctime instead of mtime, which resets
+ # every time a file/directory underneath it is deleted.
+ # Directories don't take much space, so this shouldn't be a
+ # real issue.
+ command => sprintf("/usr/bin/find %s/uploads -ignore_readdir_race -mindepth 5 -xdev -depth -type d -ctime +%d -empty -delete", shellquote($homedir), shellquote($buildsystem::var::scheduler::clean_uploads_logs_age)),
+ hour => '*/4',
+ minute => '53',
+ }
+ }
+ if ($buildsystem::var::scheduler::clean_uploads_packages_age != 0) {
+ cron { 'clean uploads packages':
+ user => $login,
+ # Delete old upload RPMs
+ command => sprintf("/usr/bin/find %s/uploads -ignore_readdir_race -xdev -depth -type f -name '*.rpm' -ctime +%d -delete", shellquote($homedir), shellquote($buildsystem::var::scheduler::clean_uploads_packages_age)),
+ hour => '*/4',
+ minute => '52',
+ }
+ }
}
diff --git a/modules/buildsystem/manifests/signbot.pp b/modules/buildsystem/manifests/signbot.pp
index 266d6cd2..60c7c318 100644
--- a/modules/buildsystem/manifests/signbot.pp
+++ b/modules/buildsystem/manifests/signbot.pp
@@ -1,39 +1,31 @@
class buildsystem::signbot {
- $login = 'signbot'
- $home_dir = "/var/lib/$login"
- $sign_keydir = "$home_dir/keys"
- # FIXME: maybe keyid should be defined at an other place
- $keyid = '80420F66'
- # FIXME refactor with base class ( once variables are
- # placed in a separate module )
- $sched_login = 'schedbot'
+ include buildsystem::var::scheduler
+ include buildsystem::var::signbot
+ $sched_login = $buildsystem::var::scheduler::login
- sshuser { $login:
- homedir => $home_dir,
- comment => 'System user used to sign packages',
+ sshuser { $buildsystem::var::signbot::login:
+ homedir => $buildsystem::var::signbot::home_dir,
groups => [$sched_login],
}
gnupg::keys{ 'packages':
- email => "packages@$::domain",
- #FIXME there should be a variable somewhere to change
- # the name of the distribution
- key_name => 'Mageia Packages',
- login => $login,
- batchdir => "$home_dir/batches",
- keydir => $sign_keydir,
+ email => $buildsystem::var::signbot::keyemail,
+ key_name => $buildsystem::var::signbot::keyname,
+ login => $buildsystem::var::signbot::login,
+ batchdir => "${buildsystem::var::signbot::home_dir}/batches",
+ keydir => $buildsystem::var::signbot::sign_keydir,
}
sudo::sudoers_config { 'signpackage':
content => template('buildsystem/signbot/sudoers.signpackage')
}
- file { "$home_dir/.rpmmacros":
- content => template('buildsystem/signbot/signbot-rpmmacros')
+ file { "${home_dir}/.rpmmacros":
+ source => 'puppet:///modules/buildsystem/signbot/signbot-rpmmacros',
}
- local_script {
- 'sign-check-package': content => template('buildsystem/signbot/sign-check-package');
- 'mga-signpackage': content => template('buildsystem/signbot/mga-signpackage');
+ mga_common::local_script {
+ 'sign-check-package': source => 'puppet:///modules/buildsystem/signbot/sign-check-package';
+ 'mga-signpackage': source => 'puppet:///modules/buildsystem/signbot/mga-signpackage';
}
}
diff --git a/modules/buildsystem/manifests/sshkeys.pp b/modules/buildsystem/manifests/sshkeys.pp
new file mode 100644
index 00000000..5a1b2900
--- /dev/null
+++ b/modules/buildsystem/manifests/sshkeys.pp
@@ -0,0 +1,5 @@
+class buildsystem::sshkeys {
+ include buildsystem::var::scheduler
+
+ sshkeys::create_key { $buildsystem::var::scheduler::login: }
+}
diff --git a/modules/buildsystem/manifests/sshuser.pp b/modules/buildsystem/manifests/sshuser.pp
index 0a1cd176..5cad97ad 100644
--- a/modules/buildsystem/manifests/sshuser.pp
+++ b/modules/buildsystem/manifests/sshuser.pp
@@ -1,5 +1,5 @@
# $groups: array of secondary groups (only local groups, no ldap)
-define buildsystem::sshuser($homedir, $comment, $groups = []) {
+define buildsystem::sshuser($homedir, $comment = undef, $groups = []) {
group { $name: }
user { $name:
@@ -9,13 +9,13 @@ define buildsystem::sshuser($homedir, $comment, $groups = []) {
gid => $name,
groups => $groups,
shell => '/bin/bash',
- notify => Exec["unlock $name"],
+ notify => Exec["unlock ${name}"],
require => Group[$title],
}
# set password to * to unlock the account but forbid login through login
- exec { "unlock $name":
- command => "usermod -p '*' $name",
+ exec { "unlock ${name}":
+ command => "usermod -p '*' ${name}",
refreshonly => true,
}
@@ -26,7 +26,7 @@ define buildsystem::sshuser($homedir, $comment, $groups = []) {
require => User[$name],
}
- file { "$homedir/.ssh":
+ file { "${homedir}/.ssh":
ensure => directory,
mode => '0600',
owner => $name,
diff --git a/modules/buildsystem/manifests/var/binrepo.pp b/modules/buildsystem/manifests/var/binrepo.pp
new file mode 100644
index 00000000..1431ed25
--- /dev/null
+++ b/modules/buildsystem/manifests/var/binrepo.pp
@@ -0,0 +1,15 @@
+# $uploadmail_from:
+# from who will be sent the binrepo upload email notifications
+# $uploadmail_to:
+# where binrepo email notifications are sent
+class buildsystem::var::binrepo(
+ $hostname = "binrepo.${::domain}",
+ $login = 'binrepo',
+ $homedir = '/var/lib/binrepo',
+ $uploadmail_from,
+ $uploadmail_to
+) {
+ $repodir = "${homedir}/data"
+ $uploadinfosdir = "${homedir}/infos"
+ $uploadbinpath = '/usr/local/bin/upload-bin'
+}
diff --git a/modules/buildsystem/manifests/var/distros.pp b/modules/buildsystem/manifests/var/distros.pp
new file mode 100644
index 00000000..9e45e2c2
--- /dev/null
+++ b/modules/buildsystem/manifests/var/distros.pp
@@ -0,0 +1,126 @@
+# $default_distro:
+# the name of the default distribution
+# $repo_allow_from_ips:
+# $repo_allow_from_domains:
+# list of IP or domains allowed to access the repository. If you don't want to
+# filter allowed IPs, don't those values.
+# $distros:
+# a hash variable containing distributions information indexed by
+# distribution name. Each distribution is itself an hash containing
+# the following infos:
+# {
+# # the 'cauldron' distribution
+# 'cauldron' => {
+# # list of arch supported by 'cauldron'
+# 'arch' => [ 'i586', 'x86_64' ],
+# # Set this if you don't want media.cfg to be generated
+# 'no_media_cfg_update' => true,
+# 'medias' => {
+# # the 'core' media
+# 'core' => {
+# 'repos' => {
+# # the 'release' repo in the 'core' media
+# 'release' => {
+# 'media_type' => [ 'release' ],
+# 'noauto' => '1',
+# # the 'release' repo should be listed first in media.cfg
+# 'order' => 0,
+# },
+# # the 'updates' repo
+# 'updates' => {
+# 'media_type' => [ 'updates' ],
+# 'noauto' => '1',
+# # the 'updates' repo requires the 'release' repo
+# 'requires' => [ 'release' ],
+# # the 'updates' repo should be listed after 'release' in media.cfg
+# 'order' => 1,
+# },
+# },
+# # media_type for media.cfg
+# 'media_type' => [ 'official', 'free' ],
+# # if noauto is set to '1' either in medias or repos,
+# # the option will be added to media.cfg
+# 'noauto' => '1',
+# # list 'core' first in media.cfg
+# 'order' => 0,
+# },
+# # the 'non-free' media
+# 'non-free' => {
+# 'repos' => {
+# ...
+# },
+# 'media_type' => [ 'official', 'non-free' ],
+# # the 'non-free' media requires the 'core' media
+# 'requires' => [ 'core' ],
+# # list 'non-free' second
+# 'order' => 1,
+# }
+# },
+# # the list of media used by iurt to build the chroots
+# 'base_medias' => [ 'core/release' ],
+# # optionally, a media.cfg template file can be specified, if
+# # the default one should not be used
+# 'tmpl_media.cfg' => 'buildsystem/something',
+# # branch is Devel or Official. Used in media.cfg.
+# 'branch' => 'Devel',
+# # Version of the distribution
+# 'version' => '3',
+# # SVN Urls allowed to submit
+# 'submit_allowed' => 'svn://svn.something/svn/packages/cauldron',
+# # rpm macros to set when build source package
+# 'macros' => {
+# 'distsuffix' => '.mga',
+# 'distribution' => 'Mageia',
+# 'vendor' => 'Mageia.Org',
+# },
+# # set this if the distro is not mirrored. This is used to add
+# # an Alias in the vhost.
+# 'no_mirror' => true,
+# Optionally, the distribution can be based on the repos from an other
+# distribution. In this example we're saying that the distribution is
+# based on 2/core/release and 2/core/updates.
+# 'based_on' => {
+# '2' => {
+# 'core' => [ 'release', 'updates' ],
+# },
+# },
+# 'youri' => {
+# # Configuration for youri-upload
+# 'upload' => {
+# # list of enabled checks, actions and posts
+# 'targets' => {
+# 'checks' => [
+# ...
+# ],
+# 'actions' => [
+# ...
+# ],
+# 'posts' => [
+# ...
+# ],
+# },
+# 'checks' => {
+# # rpmlint checks options
+# 'rpmlint' => {
+# 'config' => '/usr/share/rpmlint/config',
+# 'path' => ''/usr/bin/rpmlint',
+# },
+# },
+# # options for actions
+# 'actions' => {
+# ...
+# },
+# },
+# # Configuration for youri-todo
+# 'todo' => {
+# ...
+# },
+# },
+# },
+# }
+class buildsystem::var::distros(
+ $default_distro,
+ $repo_allow_from_ips,
+ $repo_allow_from_domains,
+ $distros,
+) { }
diff --git a/modules/buildsystem/manifests/var/groups.pp b/modules/buildsystem/manifests/var/groups.pp
new file mode 100644
index 00000000..c0b2c917
--- /dev/null
+++ b/modules/buildsystem/manifests/var/groups.pp
@@ -0,0 +1,9 @@
+# $packagers:
+# name of packagers group, who should be allowed to submit packages
+# $packagers_committers:
+# name of group of users who are allowed to commit on packages
+class buildsystem::var::groups(
+ $packagers,
+ $packagers_committers
+) {
+}
diff --git a/modules/buildsystem/manifests/var/iurt.pp b/modules/buildsystem/manifests/var/iurt.pp
new file mode 100644
index 00000000..fb65a160
--- /dev/null
+++ b/modules/buildsystem/manifests/var/iurt.pp
@@ -0,0 +1,5 @@
+class buildsystem::var::iurt(
+ $login = 'iurt',
+ $homedir = '/home/iurt',
+ $timeout_multiplier = 1,
+) { }
diff --git a/modules/buildsystem/manifests/var/maintdb.pp b/modules/buildsystem/manifests/var/maintdb.pp
new file mode 100644
index 00000000..e0079e40
--- /dev/null
+++ b/modules/buildsystem/manifests/var/maintdb.pp
@@ -0,0 +1,11 @@
+class buildsystem::var::maintdb(
+ $hostname = "maintdb.${::domain}",
+ $login = 'maintdb',
+ $homedir = '/var/lib/maintdb'
+) {
+ include buildsystem::var::webstatus
+ $dbdir = "${homedir}/db"
+ $binpath = '/usr/local/sbin/maintdb'
+ $dump = "${buildsystem::var::webstatus::location}/data/maintdb.txt"
+ $unmaintained = "${buildsystem::var::webstatus::location}/data/unmaintained.txt"
+}
diff --git a/modules/buildsystem/manifests/var/mgarepo.pp b/modules/buildsystem/manifests/var/mgarepo.pp
new file mode 100644
index 00000000..9099c7ee
--- /dev/null
+++ b/modules/buildsystem/manifests/var/mgarepo.pp
@@ -0,0 +1,22 @@
+# $submit_host:
+# hostname used to submit packages
+# $svn_hostname:
+# hostname of the svn server used for packages
+# $svn_root_packages:
+# svn root url of the svn repository for packages
+# $svn_root_packages_ssh:
+# svn+ssh root url of the svn repository for packages
+# $oldurl:
+# svn url where the import logs of the rpm are stored
+# $conf:
+# $conf{'global'} is a has table of values used in mgarepo.conf in
+# the [global] section
+class buildsystem::var::mgarepo(
+ $submit_host,
+ $svn_hostname,
+ $svn_root_packages,
+ $svn_root_packages_ssh,
+ $oldurl,
+ $conf
+) {
+}
diff --git a/modules/buildsystem/manifests/var/repository.pp b/modules/buildsystem/manifests/var/repository.pp
new file mode 100644
index 00000000..0ea1058c
--- /dev/null
+++ b/modules/buildsystem/manifests/var/repository.pp
@@ -0,0 +1,9 @@
+class buildsystem::var::repository(
+ $hostname = "repository.${::domain}",
+ $bootstrap_root = '/distrib/bootstrap',
+ $mirror_root = '/distrib/mirror',
+ $distribdir = 'distrib'
+) {
+ $bootstrap_reporoot = "${bootstrap_root}/${distribdir}"
+ $mirror_reporoot = "${mirror_root}/${distribdir}"
+}
diff --git a/modules/buildsystem/manifests/var/scheduler.pp b/modules/buildsystem/manifests/var/scheduler.pp
new file mode 100644
index 00000000..b431594c
--- /dev/null
+++ b/modules/buildsystem/manifests/var/scheduler.pp
@@ -0,0 +1,31 @@
+# $admin_mail:
+# the email address from which the build failure notifications
+# will be sent
+# $pkg_uphost:
+# hostname of the server where submitted packages are uploaded
+# $build_nodes:
+# a hash containing available build nodes indexed by architecture
+# $build_nodes_aliases:
+# a hash containing build nodes indexed by their alias
+# $build_src_node:
+# hostname of the server building the initial src.rpm
+# $clean_uploads_logs_age:
+# old logs are cleaned when they are older than some amount of days.
+# You can define this amount of time using this variable. Set it to
+# 14 for two weeks, 2 for two days, or 0 if you don't want to
+# clean old logs at all
+# $clean_uploads_packages_age:
+# same as $clean_uploads_logs_age but for old RPMs
+class buildsystem::var::scheduler(
+ $admin_mail = "root@${::domain}",
+ $pkg_uphost = "pkgsubmit.${::domain}",
+ $build_nodes,
+ $build_nodes_aliases = {},
+ $build_src_node,
+ $clean_uploads_logs_age = 14,
+ $clean_uploads_packages_age = 7
+){
+ $login = 'schedbot'
+ $homedir = "/var/lib/${login}"
+ $logdir = "/var/log/${login}"
+}
diff --git a/modules/buildsystem/manifests/var/signbot.pp b/modules/buildsystem/manifests/var/signbot.pp
new file mode 100644
index 00000000..7d92a324
--- /dev/null
+++ b/modules/buildsystem/manifests/var/signbot.pp
@@ -0,0 +1,15 @@
+# $keyid:
+# the key id of the gnupg key used to sign packages
+# $keyemail:
+# email address of the key used to sign packages
+# $keyname:
+# name of the key used to sign packages
+class buildsystem::var::signbot(
+ $keyid,
+ $keyemail,
+ $keyname
+) {
+ $login = 'signbot'
+ $home_dir = "/var/lib/${login}"
+ $sign_keydir = "${home_dir}/keys"
+}
diff --git a/modules/buildsystem/manifests/var/webstatus.pp b/modules/buildsystem/manifests/var/webstatus.pp
new file mode 100644
index 00000000..21f8d59f
--- /dev/null
+++ b/modules/buildsystem/manifests/var/webstatus.pp
@@ -0,0 +1,25 @@
+# $git_url:
+# git url where the sources of webstatus are located
+# $hostname:
+# vhost name of the webstatus page
+# $location:
+# path of the directory where the webstatus files are located
+# $package_commit_url:
+# url to view a commit on a package. %d is replaced by the commit id.
+# $max_modified:
+# how much history should we display, in days
+# $theme_name:
+# name of the webstatus theme
+# $themes_dir:
+# path of the directory where the themes are located. If you want
+# to use a theme not included in webstatus, you need to change this.
+class buildsystem::var::webstatus(
+ $git_url = "git://git.${::domain}/web/pkgsubmit",
+ $hostname = "pkgsubmit.${::domain}",
+ $location = '/var/www/bs',
+ $package_commit_url,
+ $max_modified = '2',
+ $theme_name = 'mageia',
+ $themes_dir = '/var/www/bs/themes/'
+) {
+}
diff --git a/modules/buildsystem/manifests/var/youri.pp b/modules/buildsystem/manifests/var/youri.pp
new file mode 100644
index 00000000..f20b6c7b
--- /dev/null
+++ b/modules/buildsystem/manifests/var/youri.pp
@@ -0,0 +1,401 @@
+# The youri configuration files are created using information from 3
+# different hash variables :
+# - the $youri_conf_default variable defined in this class, containing
+# the default configuration for youri. It contains the repository
+# configuration, and the definitions of the checks, actions and posts.
+# - the $youri_conf parameter passed to this class. The values defined
+# in this hash override the values defined in the default configuration.
+# - for each distribution defined in the hash variable $distros from
+# var::buildsystem::distros the hash defined in index 'youri' contains
+# some distro specific options for youri checks, actions or posts. It
+# also contains for each distribution the list of active checks,
+# actions and posts.
+#
+# Each of those variables contain the configuration for youri submit-todo
+# (in index 'todo') and youri submit-upload (in index 'upload')
+#
+#
+# Parameters :
+# $tmpl_youri_upload_conf:
+# template file for youri submit-upload.conf
+# $tmpl_youri_todo_conf:
+# template file for youri submit-todo.conf
+# $packages_archivedir:
+# the directory where youri will archive old packages when they are
+# replaced by a new version
+# $youri_conf:
+# a hash containing the youri configuration
+class buildsystem::var::youri(
+ $tmpl_youri_upload_conf = 'buildsystem/youri/submit.conf',
+ $tmpl_youri_todo_conf = 'buildsystem/youri/submit.conf',
+ $packages_archivedir,
+ $youri_conf = {}
+) {
+ include buildsystem::var::repository
+ include buildsystem::var::mgarepo
+ include buildsystem::var::distros
+ include buildsystem::var::signbot
+ include buildsystem::var::scheduler
+
+ $check_tag = { 'class' => 'Youri::Submit::Check::Tag', }
+ $check_recency = { 'class' => 'Youri::Submit::Check::Recency', }
+ $check_queue_recency = { 'class' => 'Youri::Submit::Check::Queue_recency', }
+ $check_host = {
+ 'class' => 'Youri::Submit::Check::Host',
+ 'options' => {
+ 'host_file' => '/etc/youri/host.conf',
+ },
+ }
+ $check_rpmlint = { 'class' => 'Youri::Submit::Check::Rpmlint', }
+ $check_acl = {
+ 'class' => 'Youri::Submit::Check::ACL',
+ 'options' => {
+ 'acl_file' => '/etc/youri/acl.conf',
+ },
+ }
+ $check_source = { 'class' => 'Youri::Submit::Check::Source', }
+ $check_version = {
+ 'class' => 'Youri::Submit::Check::Version',
+ 'options' => {},
+ }
+
+ $youri_conf_default = {
+ 'upload' => {
+ 'repository' => {
+ 'class' => 'Youri::Repository::Mageia',
+ 'options' => {
+ 'install_root' => $buildsystem::var::repository::bootstrap_reporoot,
+ 'upload_root' => '$home/uploads/',
+ 'archive_root' => $packages_archivedir,
+ 'upload_state' => 'queue',
+ 'queue' => 'queue',
+ 'noarch' => 'x86_64',
+ 'svn' => "${buildsystem::var::mgarepo::svn_root_packages_ssh}/${buildsystem::var::distros::default_distro}",
+ },
+ },
+ 'checks' => {
+ 'tag' => $check_tag,
+ 'recency' => $check_recency,
+ 'queue_recency' => $check_queue_recency,
+ 'host' => $check_host,
+ 'section' => {
+ 'class' => 'Youri::Submit::Check::Section',
+ },
+ 'rpmlint' => $check_rpmlint,
+ 'svn' => {
+ 'class' => 'Youri::Submit::Check::SVN',
+ },
+ 'acl' => $check_acl,
+ 'history' => {
+ 'class' => 'Youri::Submit::Check::History',
+ },
+ 'source' => $check_source,
+ 'precedence' => {
+ 'class' => 'Youri::Submit::Check::Precedence',
+ 'options' => {
+ 'target' => $buildsystem::var::distros::default_distro,
+ },
+ },
+ 'version' => $check_version,
+ },
+ 'actions' => {
+ 'install' => {
+ 'class' => 'Youri::Submit::Action::Install',
+ },
+ 'markrelease' => {
+ 'class' => 'Youri::Submit::Action::Markrelease',
+ },
+ 'link' => {
+ 'class' => 'Youri::Submit::Action::Link',
+ },
+ 'archive' => {
+ 'class' => 'Youri::Submit::Action::Archive',
+ },
+ 'clean' => {
+ 'class' => 'Youri::Submit::Action::Clean',
+ },
+ 'sign' => {
+ 'class' => 'Youri::Submit::Action::Sign',
+ 'options' => {
+ 'signuser' => $buildsystem::var::signbot::login,
+ 'path' => $buildsystem::var::signbot::sign_keydir,
+ 'name' => $buildsystem::var::signbot::keyid,
+ 'signscript' => '/usr/local/bin/sign-check-package',
+ },
+ },
+ 'unpack_gfxboot_theme' => {
+ 'class' => 'Youri::Submit::Action::Unpack',
+ 'options' => {
+ 'name' => 'mageia-gfxboot-theme',
+ 'source_subdir' => '/usr/share/gfxboot/themes/Mageia/install/',
+ 'dest_directory' => 'isolinux',
+ 'unpack_inside_distribution_root' => '1',
+ },
+ },
+ 'unpack_meta_task' => {
+ 'class' => 'Youri::Submit::Action::Unpack',
+ 'options' => {
+ 'name' => 'meta-task',
+ 'source_subdir' => '/usr/share/meta-task',
+ 'dest_directory' => 'media/media_info',
+ 'unpack_inside_distribution_root' => '1',
+ },
+ },
+ 'unpack_installer_images' => {
+ 'class' => 'Youri::Submit::Action::Unpack',
+ 'options' => {
+ 'name' => 'drakx-installer-images',
+ 'source_subdir' => '/usr/lib*/drakx-installer-images',
+ 'dest_directory' => '.',
+ 'preclean_directory' => 'install/images/alternatives',
+ 'unpack_inside_distribution_root' => '1',
+ },
+ },
+ 'unpack_installer_images_nonfree' => {
+ 'class' => 'Youri::Submit::Action::Unpack',
+ 'options' => {
+ 'name' => 'drakx-installer-images-nonfree',
+ 'source_subdir' => '/usr/lib*/drakx-installer-images',
+ 'dest_directory' => '.',
+ 'unpack_inside_distribution_root' => '1',
+ },
+ },
+ 'unpack_installer_stage2' => {
+ 'class' => 'Youri::Submit::Action::Unpack',
+ 'options' => {
+ 'name' => 'drakx-installer-stage2',
+ 'source_subdir' => '/usr/lib*/drakx-installer-stage2',
+ 'dest_directory' => '.',
+ 'unpack_inside_distribution_root' => '1',
+ },
+ },
+ 'unpack_installer_advertising' => {
+ 'class' => 'Youri::Submit::Action::Unpack',
+ 'options' => {
+ 'name' => 'drakx-installer-advertising',
+ 'source_subdir' => '/usr/share/drakx-installer-advertising',
+ 'dest_directory' => '.',
+ 'unpack_inside_distribution_root' => '1',
+ },
+ },
+ 'unpack_installer_rescue' => {
+ 'class' => 'Youri::Submit::Action::Unpack',
+ 'options' => {
+ 'name' => 'drakx-installer-rescue',
+ 'source_subdir' => '/usr/lib*/drakx-installer-rescue',
+ 'dest_directory' => 'install/stage2',
+ 'unpack_inside_distribution_root' => '1',
+ },
+ },
+ 'unpack_release_notes' => {
+ 'class' => 'Youri::Submit::Action::Unpack',
+ 'options' => {
+ 'name' => 'mageia-release-common',
+ 'source_subdir' => '/usr/share/doc/mageia-release-common',
+ 'grep_files' => 'release-notes.*',
+ 'dest_directory' => '.',
+ 'unpack_inside_distribution_root' => '1',
+ },
+ },
+ 'unpack_syslinux' => {
+ 'class' => 'Youri::Submit::Action::Unpack',
+ 'options' => {
+ 'name' => 'syslinux',
+ 'source_subdir' => '/usr/lib/syslinux/',
+ 'grep_files' => '\\(hdt\\|ifcpu\\|ldlinux\\|libcom32\\|libgpl\\|libmenu\\|libutil\\).c32',
+ 'dest_directory' => 'isolinux',
+ 'unpack_inside_distribution_root' => '1',
+ },
+ },
+ 'unpack_pci_usb_ids' => {
+ 'class' => 'Youri::Submit::Action::Unpack',
+ 'options' => {
+ 'name' => 'ldetect-lst',
+ 'source_subdir' => '/usr/share/',
+ 'grep_files' => '\\(pci\\|usb\\).ids',
+ 'dest_directory' => 'isolinux',
+ 'unpack_inside_distribution_root' => '1',
+ },
+ },
+ 'mail' => {
+ 'class' => 'Youri::Submit::Action::Mail',
+ 'options' => {
+ 'mta' => '/usr/sbin/sendmail',
+ },
+ },
+ 'maintdb' => {
+ 'class' => 'Youri::Submit::Action::UpdateMaintDb',
+ },
+ 'rebuild' => {
+ 'class' => 'Youri::Submit::Action::RebuildPackage',
+ 'options' => {
+ 'rules' => {
+ 'drakx-installer-binaries' => ['drakx-installer-images'],
+ 'drakx-kbd-mouse-x11' => ['drakx-installer-stage2'],
+ 'drakx-net' => ['drakx-installer-stage2'],
+ 'kernel-desktop-latest' => ['drakx-installer-images', 'kmod-virtualbox', 'kmod-xtables-addons'],
+ 'kernel-desktop586-latest' => ['drakx-installer-images', 'kmod-virtualbox', 'kmod-xtables-addons'],
+ 'kernel-server-latest' => ['kmod-virtualbox', 'kmod-xtables-addons'],
+ 'ldetect-lst' => ['drakx-installer-stage2'],
+ 'meta-task' => ['drakx-installer-stage2'],
+ 'perl' => ['drakx-installer-stage2'],
+ 'perl-URPM' => ['drakx-installer-stage2'],
+ 'rpm' => ['drakx-installer-stage2'],
+ 'rpm-mageia-setup' => ['drakx-installer-stage2'],
+ 'urpmi' => ['drakx-installer-stage2'],
+ },
+ },
+ },
+ },
+ 'posts' => {
+ 'genhdlist2' => {
+ 'class' => 'Youri::Submit::Post::Genhdlist2',
+ 'options' => {
+ 'command' => '/usr/bin/genhdlist2 --xml-info-filter ".lzma:xz -T4" --synthesis-filter ".cz:xz -7 -T8"',
+ },
+ },
+ 'genhdlist2_zstd' => {
+ 'class' => 'Youri::Submit::Post::Genhdlist2',
+ 'options' => {
+ 'command' => '/usr/bin/genhdlist2 --xml-info-filter ".lzma:xz -T4" --synthesis-filter ".cz:zstd -19 -T8"',
+ },
+ },
+ 'createrepo_mga6' => {
+ 'class' => 'Youri::Submit::Post::RunOnModifiedMedia',
+ 'options' => {
+ 'command' => 'createrepo_c --no-database --update --workers=10',
+ },
+ },
+ 'createrepo_mga7' => {
+ 'class' => 'Youri::Submit::Post::RunOnModifiedMedia',
+ 'options' => {
+ 'command' => 'createrepo_c --no-database --update --workers=10 --zck --zck-dict-dir /usr/share/mageia-repo-zdicts/mga7/',
+ },
+ },
+ 'createrepo_mga8' => {
+ 'class' => 'Youri::Submit::Post::RunOnModifiedMedia',
+ 'options' => {
+ 'command' => 'createrepo_c --no-database --update --workers=10 --zck --zck-dict-dir /usr/share/mageia-repo-zdicts/mga7/',
+ },
+ },
+ 'createrepo_mga9' => {
+ 'class' => 'Youri::Submit::Post::RunOnModifiedMedia',
+ 'options' => {
+ 'command' => 'createrepo_c --no-database --update --workers=10 --zck --zck-dict-dir /usr/share/mageia-repo-zdicts/mga7/',
+ },
+ },
+ 'createrepo_cauldron' => {
+ 'class' => 'Youri::Submit::Post::RunOnModifiedMedia',
+ 'options' => {
+ 'command' => 'createrepo_c --no-database --update --workers=10',
+ },
+ },
+ 'appstream_mga6' => {
+ 'class' => 'Youri::Submit::Post::RunOnModifiedMedia',
+ 'options' => {
+ 'command' => '/distrib/appstream/appstream-6-modifyrepo.sh',
+ },
+ },
+ 'appstream_mga7' => {
+ 'class' => 'Youri::Submit::Post::RunOnModifiedMedia',
+ 'options' => {
+ 'command' => '/distrib/appstream/appstream-7-modifyrepo.sh',
+ },
+ },
+ 'appstream_mga8' => {
+ 'class' => 'Youri::Submit::Post::RunOnModifiedMedia',
+ 'options' => {
+ 'command' => '/distrib/appstream/appstream-8-modifyrepo.sh',
+ },
+ },
+ 'appstream_mga9' => {
+ 'class' => 'Youri::Submit::Post::RunOnModifiedMedia',
+ 'options' => {
+ 'command' => '/distrib/appstream/appstream-9-modifyrepo.sh',
+ },
+ },
+ 'appstream_cauldron' => {
+ 'class' => 'Youri::Submit::Post::RunOnModifiedMedia',
+ 'options' => {
+ 'command' => '/distrib/appstream/appstream-cauldron-modifyrepo.sh',
+ },
+ },
+ 'clean_rpmsrate' => {
+ 'class' => 'Youri::Submit::Post::CleanRpmsrate',
+ },
+ 'mirror' => {
+ 'class' => 'Youri::Submit::Post::Mirror',
+ 'options' => {
+ 'destination' => $buildsystem::var::repository::mirror_reporoot,
+ },
+ },
+ },
+ },
+ 'todo' => {
+ 'repository' => {
+ 'class' => 'Youri::Repository::Mageia',
+ 'options' => {
+ 'install_root' => $buildsystem::var::repository::bootstrap_reporoot,
+ 'upload_root' => '$home/uploads/',
+ 'upload_state' => 'todo done queue',
+ 'queue' => 'todo',
+ 'noarch' => 'x86_64',
+ 'svn' => "${buildsystem::var::mgarepo::svn_root_packages_ssh}/${buildsystem::var::distros::default_distro}",
+ },
+ },
+ 'checks' => {
+ 'tag' => $check_tag,
+ 'recency' => $check_recency,
+ 'queue_recency' => $check_queue_recency,
+ 'host' => $check_host,
+ 'rpmlint' => $check_rpmlint,
+ 'acl' => $check_acl,
+ 'source' => $check_source,
+ 'version' => $check_version,
+ 'deps' => {
+ 'class' => 'Youri::Submit::Check::Deps',
+ },
+ },
+ 'actions' => {
+ 'send' => {
+ 'class' => 'Youri::Submit::Action::Send',
+ 'options' => {
+ 'user' => $buildsystem::var::scheduler::login,
+ 'keep_svn_release' => 'yes',
+ 'uphost' => $buildsystem::var::scheduler::pkg_uphost,
+ 'root' => '$home/uploads',
+ 'ssh_key' => '$home/.ssh/id_rsa',
+ },
+ },
+ 'dependencies' => {
+ 'class' => 'Youri::Submit::Action::Dependencies',
+ 'options' => {
+ 'user' => $buildsystem::var::scheduler::login,
+ 'uphost' => $buildsystem::var::scheduler::pkg_uphost,
+ 'root' => '$home/uploads',
+ 'ssh_key' => '$home/.ssh/id_rsa',
+ },
+ },
+ 'rpminfo' => {
+ 'class' => 'Youri::Submit::Action::Rpminfo',
+ 'options' => {
+ 'user' => $buildsystem::var::scheduler::login,
+ 'uphost' => $buildsystem::var::scheduler::pkg_uphost,
+ 'root' => '$home/uploads',
+ 'ssh_key' => '$home/.ssh/id_rsa',
+ },
+ },
+ 'ulri' => {
+ 'class' => 'Youri::Submit::Action::Ulri',
+ 'options' => {
+ 'user' => $buildsystem::var::scheduler::login,
+ 'uphost' => $buildsystem::var::scheduler::pkg_uphost,
+ 'ssh_key' => '$home/.ssh/id_rsa',
+ },
+ },
+ },
+ 'posts' => {
+ },
+ },
+ }
+}
diff --git a/modules/buildsystem/manifests/webstatus.pp b/modules/buildsystem/manifests/webstatus.pp
new file mode 100644
index 00000000..49346dbc
--- /dev/null
+++ b/modules/buildsystem/manifests/webstatus.pp
@@ -0,0 +1,44 @@
+class buildsystem::webstatus {
+ include buildsystem::var::webstatus
+ include buildsystem::var::scheduler
+ include apache::mod::php
+
+ file { [ $buildsystem::var::webstatus::location, "${buildsystem::var::webstatus::location}/data" ]:
+ ensure => directory,
+ }
+
+ $vhost = $buildsystem::var::webstatus::hostname
+ apache::vhost::base { $vhost:
+ aliases => {
+ '/uploads' => "${buildsystem::var::scheduler::homedir}/uploads",
+ '/autobuild/cauldron/x86_64/core/log/status.core.log' => "${buildsystem::var::webstatus::location}/autobuild/broken.php",
+ '/themes' => $buildsystem::var::webstatus::themes_dir,
+ },
+ location => $buildsystem::var::webstatus::location,
+ content => template('buildsystem/vhost_webstatus.conf'),
+ }
+
+ apache::vhost::base { "ssl_${vhost}":
+ vhost => $vhost,
+ use_ssl => true,
+ aliases => {
+ '/uploads' => "${buildsystem::var::scheduler::homedir}/uploads",
+ '/autobuild/cauldron/x86_64/core/log/status.core.log' => "${buildsystem::var::webstatus::location}/autobuild/broken.php",
+ '/themes' => $buildsystem::var::webstatus::themes_dir,
+ },
+ location => $buildsystem::var::webstatus::location,
+ content => template('buildsystem/vhost_webstatus.conf'),
+ }
+
+ git::snapshot { $buildsystem::var::webstatus::location:
+ source => $buildsystem::var::webstatus::git_url,
+ }
+
+ file { '/etc/bs-webstatus.conf':
+ ensure => present,
+ content => template('buildsystem/bs-webstatus.conf'),
+ mode => '0644',
+ owner => root,
+ group => root,
+ }
+}
diff --git a/modules/buildsystem/manifests/youri_submit.pp b/modules/buildsystem/manifests/youri_submit.pp
index 9b5feb51..6b4d7dc2 100644
--- a/modules/buildsystem/manifests/youri_submit.pp
+++ b/modules/buildsystem/manifests/youri_submit.pp
@@ -1,51 +1,72 @@
class buildsystem::youri_submit {
- $sched_home_dir = $buildsystem::base::sched_home_dir
- $sched_login = $buildsystem::base::sched_login
- $packages_archivedir = "$sched_home_dir/old"
-
include sudo
include buildsystem::rpmlint
+ include buildsystem::repository
+ include buildsystem::var::scheduler
+ include buildsystem::var::youri
- local_script {
+ mga_common::local_script {
'mga-youri-submit':
content => template('buildsystem/mga-youri-submit');
'mga-youri-submit.wrapper':
content => template('buildsystem/mga-youri-submit.wrapper');
'submit_package':
content => template('buildsystem/submit_package.pl');
+ 'mga-clean-distrib':
+ content => template('buildsystem/cleaner.rb');
}
sudo::sudoers_config { 'mga-youri-submit':
content => template('buildsystem/sudoers.youri')
}
+ $release_managers = group_members('mga-release_managers')
# ordering is automatic :
- # http://docs.puppetlabs.com/learning/ordering.html#autorequire
+ # https://docs.puppetlabs.com/learning/ordering.html#autorequire
file {
'/etc/youri/':
- ensure => 'directory',
- '/etc/youri/submit-todo.conf':
- content => template('buildsystem/youri/submit-todo.conf');
- '/etc/youri/submit-upload.conf':
- content => template('buildsystem/youri/submit-upload.conf');
+ ensure => 'directory';
'/etc/youri/acl.conf':
content => template('buildsystem/youri/acl.conf');
+ '/etc/youri/host.conf':
+ content => template('buildsystem/youri/host.conf');
+ }
+
+ buildsystem::youri_submit_conf{ 'upload':
+ tmpl_file => $buildsystem::var::youri::tmpl_youri_upload_conf,
+ }
+ buildsystem::youri_submit_conf{ 'todo':
+ tmpl_file => $buildsystem::var::youri::tmpl_youri_todo_conf,
}
- file { $packages_archivedir:
+ cron { 'Archive orphan packages from cauldron':
+ command => "/usr/local/bin/mga-clean-distrib --auto -v cauldron -d ${buildsystem::var::youri::packages_archivedir} -l ${buildsystem::var::scheduler::homedir}/tmp/upload",
+ hour => 5,
+ minute => 30,
+ user => $buildsystem::var::scheduler::login,
+ }
+
+ file { $buildsystem::var::youri::packages_archivedir:
ensure => 'directory',
- owner => $sched_login,
- require => File[$sched_home_dir],
+ owner => $buildsystem::var::scheduler::login,
+ require => File[$buildsystem::var::scheduler::homedir],
}
- tidy { $packages_archivedir:
+ tidy { $buildsystem::var::youri::packages_archivedir:
type => 'ctime',
recurse => true,
age => '1w',
matches => '*.rpm',
}
- # FIXME use /usr/local/ once it will be in @INC
- file { '/usr/lib/perl5/vendor_perl/5.12.3/Youri/Repository/Mageia.pm':
+ include mga_common::var::perl
+ file { [ "${mga_common::var::perl::site_perl_dir}/Youri",
+ "${mga_common::var::perl::site_perl_dir}/Youri/Repository"]:
+ ensure => directory,
+ mode => '0755',
+ owner => root,
+ group => root,
+ }
+ file { "${mga_common::var::perl::site_perl_dir}/Youri/Repository/Mageia.pm":
source => 'puppet:///modules/buildsystem/Mageia.pm',
}
diff --git a/modules/buildsystem/manifests/youri_submit_conf.pp b/modules/buildsystem/manifests/youri_submit_conf.pp
new file mode 100644
index 00000000..28b911d9
--- /dev/null
+++ b/modules/buildsystem/manifests/youri_submit_conf.pp
@@ -0,0 +1,6 @@
+define buildsystem::youri_submit_conf($tmpl_file) {
+ $conf_name = $name
+ file { "/etc/youri/submit-${conf_name}.conf":
+ content => template($tmpl_file),
+ }
+}
diff --git a/modules/buildsystem/templates/binrepo/sudoers.binrepo b/modules/buildsystem/templates/binrepo/sudoers.binrepo
index 405f43a3..c20810cf 100644
--- a/modules/buildsystem/templates/binrepo/sudoers.binrepo
+++ b/modules/buildsystem/templates/binrepo/sudoers.binrepo
@@ -1 +1 @@
-%<%= packagers_committers_group %> ALL =(<%= login %>) NOPASSWD: <%= uploadbinpath %>
+%<%= scope.lookupvar('buildsystem::var::groups::packagers_committers') %> ALL =(<%= scope.lookupvar('buildsystem::var::binrepo::login') %>) NOPASSWD: <%= scope.lookupvar('buildsystem::var::binrepo::uploadbinpath') %>
diff --git a/modules/buildsystem/templates/binrepo/upload-bin b/modules/buildsystem/templates/binrepo/upload-bin
index c67f045a..7cad5838 100755
--- a/modules/buildsystem/templates/binrepo/upload-bin
+++ b/modules/buildsystem/templates/binrepo/upload-bin
@@ -1,9 +1,11 @@
#!/bin/sh
-binrepodir=<%= repodir %>
-uploadinfosdir=<%= uploadinfosdir %>
+set -e
+
+binrepodir=<%= scope.lookupvar('buildsystem::var::binrepo::repodir') %>
+uploadinfosdir=<%= scope.lookupvar('buildsystem::var::binrepo::uploadinfosdir') %>
tmpfile=$(mktemp)
-mail_from="<%= uploadmail_from %>"
-mail_dest="<%= uploadmail_to %>"
+mail_from="<%= scope.lookupvar('buildsystem::var::binrepo::uploadmail_from') %>"
+mail_dest="<%= scope.lookupvar('buildsystem::var::binrepo::uploadmail_to') %>"
test $# = 2 || exit 3
username="$1"
@@ -11,6 +13,7 @@ comment="$2"
/bin/cat > "$tmpfile"
sha1sum=$(/usr/bin/sha1sum "$tmpfile" | sed 's/ .*$//')
+test -n "$sha1sum"
if [ -f "$binrepodir/$sha1sum" ]
then
echo "File $sha1sum already exists." >&2
diff --git a/modules/buildsystem/templates/binrepo/vhost_binrepo.conf b/modules/buildsystem/templates/binrepo/vhost_binrepo.conf
index ce29accf..f411c07a 100644
--- a/modules/buildsystem/templates/binrepo/vhost_binrepo.conf
+++ b/modules/buildsystem/templates/binrepo/vhost_binrepo.conf
@@ -1,3 +1,3 @@
-<Directory <%= repodir %>>
+<Directory <%= scope.lookupvar('buildsystem::var::binrepo::repodir') %>>
Options None
</Directory>
diff --git a/modules/buildsystem/templates/binrepo/wrapper.upload-bin b/modules/buildsystem/templates/binrepo/wrapper.upload-bin
index 48385a47..3def84a0 100644
--- a/modules/buildsystem/templates/binrepo/wrapper.upload-bin
+++ b/modules/buildsystem/templates/binrepo/wrapper.upload-bin
@@ -1,8 +1,8 @@
#!/bin/sh
-binrepouser="<%= login %>"
-uploadbinpath="<%= uploadbinpath %>"
-packagerscommittersgroup="<%= packagers_committers_group %>"
+binrepouser="<%= scope.lookupvar('buildsystem::var::binrepo::login') %>"
+uploadbinpath="<%= scope.lookupvar('buildsystem::var::binrepo::uploadbinpath') %>"
+packagerscommittersgroup="<%= scope.lookupvar('buildsystem::var::groups::packagers_committers') %>"
function isingroup()
{
diff --git a/modules/buildsystem/templates/bs-webstatus.conf b/modules/buildsystem/templates/bs-webstatus.conf
new file mode 100644
index 00000000..9f37a990
--- /dev/null
+++ b/modules/buildsystem/templates/bs-webstatus.conf
@@ -0,0 +1,32 @@
+<?php
+
+/** Where is the current app located. */
+$g_webapp_dir = '<%= scope.lookupvar('buildsystem::var::webstatus::location') %>';
+
+/** Full system path where packages are uploaded. */
+$upload_dir = '<%= scope.lookupvar('buildsystem::var::scheduler::homedir') %>/uploads';
+
+/** How long a history should we keep, in days. */
+$max_modified = <%= scope.lookupvar('buildsystem::var::webstatus::max_modified') %>;
+
+/** How many nodes are available. */
+$g_nodes_count = 2;
+
+/** html > body > h1 title */
+$title = 'Build system status';
+
+/** Should crawlers index this page or not? meta[robots] tag.*/
+$robots = 'index,nofollow,nosnippet,noarchive';
+
+/** */
+$g_root_url = 'https://<%= scope.lookupvar('buildsystem::var::webstatus::hostname') %>/';
+
+/** URL to view a package svn revision. %d is replaced by the revision */
+$package_commit_url = '<%= scope.lookupvar('buildsystem::var::webstatus::package_commit_url') %>';
+
+/** name of the theme */
+$theme_name = '<%= scope.lookupvar('buildsystem::var::webstatus::theme_name') %>';
+
+/** themes directory */
+$themes_dir = '<%= scope.lookupvar('buildsystem::var::webstatus::themes_dir') %>';
+
diff --git a/modules/buildsystem/templates/cleaner.rb b/modules/buildsystem/templates/cleaner.rb
new file mode 100755
index 00000000..fa0d08ca
--- /dev/null
+++ b/modules/buildsystem/templates/cleaner.rb
@@ -0,0 +1,235 @@
+#!/usr/bin/ruby
+
+def usage
+ puts "Usage: #{$0} [options]"
+ puts "Moves obsolete packages"
+ puts
+ puts "-h, --help show this help"
+ puts "-a, --archs <arch1>,<arch2>,... list of architectures to clean"
+ puts "-a, --auto do not ask confirmation"
+ puts "-p, --base <path> base path to the repository"
+ puts "-m, --media <media1>,<media2>,... list of media to clean (default: core/release,tainted/release,nonfree/release)"
+ puts "-d, --destination <path> path to the old packages storage"
+ puts "-v, --version <version> version to clean (default: cauldron)"
+end
+
+require 'fileutils'
+require 'getoptlong'
+require 'readline'
+
+def process
+ opts = GetoptLong.new(
+ [ '--help', '-h', GetoptLong::NO_ARGUMENT ],
+ [ '--archs', '-a', GetoptLong::REQUIRED_ARGUMENT ],
+ [ '--auto', '-A', GetoptLong::NO_ARGUMENT ],
+ [ '--base', '-p', GetoptLong::REQUIRED_ARGUMENT ],
+ [ '--media', '-m', GetoptLong::REQUIRED_ARGUMENT ],
+ [ '--destination', '-d', GetoptLong::REQUIRED_ARGUMENT ],
+ [ '--version', '-v', GetoptLong::REQUIRED_ARGUMENT ],
+ [ '--lockfile', '-l', GetoptLong::REQUIRED_ARGUMENT ],
+ )
+
+ base_path = "<%= scope.lookupvar('buildsystem::var::repository::bootstrap_root') %>/distrib"
+ archs = [ "x86_64", "i686", "aarch64", "armv7hl" ]
+ medias = ["core/release", "tainted/release", "nonfree/release"]
+ old_path = "<%= scope.lookupvar('buildsystem::var::youri::packages_archivedir') %>"
+ version = "cauldron"
+ auto = false
+ lockfile = nil
+
+ opts.each do |opt, arg|
+ case opt
+ when '--help'
+ usage
+ exit 0
+ when '--destination'
+ old_path = arg
+ when '--media'
+ medias = arg.split(",")
+ when '--archs'
+ archs = arg.split(",")
+ when '--auto'
+ auto = true
+ when '--base'
+ base_path = arg
+ when '--version'
+ version = arg
+ when '--lockfile'
+ lockfile = arg
+ end
+ end
+
+ take_upload_lock(lockfile) if lockfile
+
+ medias.each{|media|
+ src_path = "#{base_path}/#{version}/SRPMS/#{media}"
+
+ $used_srcs = {}
+ $old_srcs = {}
+ $srcs = {}
+ $srcages = {}
+ $noarch = {}
+
+ # Get a list of all src.rpm and their build time
+ `urpmf --synthesis "#{src_path}/media_info/synthesis.hdlist.cz" --qf '%filename:%buildtime:%buildarchs' "."`.each_line{|l|
+ l2 = l.split(':')
+ filename = l2[0]
+ buildtime = l2[1].to_i
+ buildarch = l2[2].rstrip
+ name = name_from_filename(filename)
+ if $srcages[name] then
+ if buildtime < $srcages[name][1] then
+ # This src.rpm is older, ignore it and store it in the list to be deleted
+ $old_srcs[filename] = true
+ next
+ else
+ # This src.rpm has an older version, ignore that version and store it in the list to be deleted
+ old_filename = $srcages[name][0]
+ $old_srcs[old_filename] = true
+ $srcs.delete(old_filename)
+ end
+ end
+ $srcages[name] = [ filename, buildtime ]
+ $srcs[filename] = true
+ $noarch[name] = true if buildarch == 'noarch'
+ }
+ archs.each{|arch|
+ bin_path = "#{base_path}/#{version}/#{arch}/media/#{media}"
+ debug_path = bin_path.sub("/media/", "/media/debug/")
+ old_packages = check_binaries(arch, $srcs, $srcages, src_path, bin_path, $used_srcs)
+ old_debug_packages = check_binaries(arch, $srcs, {}, src_path, debug_path, nil)
+ move_packages(bin_path, old_path, old_packages, auto)
+ move_packages(debug_path, old_path, old_debug_packages, auto)
+ }
+ $used_srcs.keys.each{|s| $srcs.delete(s)}
+
+ move_packages(src_path, old_path, $srcs.keys + $old_srcs.keys, auto)
+ }
+end
+
+def take_upload_lock(path)
+ start_time = Time.new
+ has_lock = false
+ at_exit {
+ if File.exists?(path)
+ if File.readlines(path)[0].to_i == Process.pid
+ File.delete(path)
+ end
+ end
+ }
+ until has_lock
+ while File.exists?(path)
+ if Time.new - start_time > 2*3600.0
+ puts "Could not acquire upload lock for more than 2h, giving up"
+ end
+ sleep(5)
+ end
+ File.write(path, Process.pid)
+ if File.readlines(path)[0].to_i == Process.pid
+ has_lock = true
+ end
+ end
+end
+
+def move_packages(src, dst, list, auto)
+ list.reject!{|f| !File.exist?(src + "/" + f)}
+ return if list.empty?
+ list.each{|b|
+ puts b
+ }
+ puts "The #{list.length} listed packages will be moved from #{src} to #{dst}."
+ line = Readline::readline('Are you sure [Yn]? ') unless auto
+ if auto || line =~ /^y?$/i
+ list.each{|s|
+ oldfile = src + "/" + s
+ newfile = dst + "/" + s
+ next unless File.exist?(oldfile)
+ if (File.exist?(newfile))
+ File.unlink(oldfile)
+ else
+ FileUtils.mv(oldfile, newfile)
+ end
+ }
+ end
+end
+
+# For each binary media:
+# - Check if we have the src.rpm (else the binary package is obsolete)
+# * If we don't have the src.rpm, check if we have a newer version
+# - If there is a new version:
+# * check if this architecture has packages from it to avoid deleting armv7hl packages before the new one get rebuilt
+# * check if the new version is old enough to allow rebuilding everything (7d?)
+# - Mark used src.rpm (if one is never marked, the src.rpm is obsolete)
+
+def packages(path)
+ `urpmf --synthesis "#{path}/media_info/synthesis.hdlist.cz" --qf '%sourcerpm:%filename:%buildtime' ":"`.each_line{|l|
+ l2 = l.split(':')
+ sourcerpm = l2[0]
+ filename = l2[1]
+ buildtime = l2[2].to_i
+ yield(sourcerpm, filename, buildtime)
+ }
+end
+
+def name_from_filename(filename)
+ filename.sub(/-[^-]*-[^-]*$/, '')
+end
+
+def arch_wanted(src, arch)
+ exclusive_arch = `rpmquery -p #{src} --qf '[%{EXCLUSIVEARCH} ]'`.rstrip
+ if exclusive_arch != "" then
+ if !exclusive_arch.split(/ /).include?(arch) then
+ return false
+ end
+ end
+ exclude_arch = `rpmquery -p #{src} --qf '[%{EXCLUDEARCH} ]'`.rstrip
+ if exclude_arch != "" then
+ if exclude_arch.split(/ /).include?(arch) then
+ return false
+ end
+ end
+
+ return true
+end
+
+def check_binaries(arch, srcs, srcages, src_path, path, used_srcs)
+ used_here_srcs = {}
+ all_versions = {}
+ packages(path) {|src, filename, buildtime|
+ used_srcs[src] = true if used_srcs != nil
+ if filename =~ /noarch.rpm$/ then
+ # We need to mark the src.rpm present on this arch only for full noarch packages
+ used_here_srcs[src] = true if $noarch[name_from_filename(src)]
+ else
+ used_here_srcs[src] = true
+ end
+ name = name_from_filename(filename)
+ if all_versions[name] then
+ all_versions[name] << src
+ else
+ all_versions[name] = [src]
+ end
+ }
+ old_binaries = []
+ packages(path) {|src, filename, buildtime|
+ if ! srcs[src] then
+ srcname = name_from_filename(src)
+ if srcages[srcname] then
+ # The src.rpm is gone but there is a different version of it
+ latestsrc = srcages[srcname][0]
+ # Only delete old binaries after 7d or if there is a new version
+ name = name_from_filename(filename)
+ next unless (srcages[srcname][1] < Time.now.to_i - 24*60*60*7 || all_versions[name].include?(latestsrc))
+ # Do not delete if the new version of the package hasn't been built for this arch yet
+ # but still delete it if it is no longer expected to be built.
+ next unless (used_here_srcs[latestsrc] || !arch_wanted("#{src_path}/#{latestsrc}", arch))
+ end
+ old_binaries << filename
+ end
+ }
+ old_binaries
+end
+
+if __FILE__ == $0 then
+ process
+end
diff --git a/modules/buildsystem/templates/cleaner_test.rb b/modules/buildsystem/templates/cleaner_test.rb
new file mode 100644
index 00000000..804bd1b5
--- /dev/null
+++ b/modules/buildsystem/templates/cleaner_test.rb
@@ -0,0 +1,83 @@
+require 'cleaner'
+require "test/unit"
+
+class TestCleaner < Test::Unit::TestCase
+
+ @pkgs = []
+
+ def setpackages(pkgs)
+ @pkgs = pkgs
+ end
+
+ def packages(path)
+ @pkgs.map{|p|
+ l2 = p.split(':')
+ sourcerpm = l2[0]
+ filename = l2[1]
+ buildtime = l2[2].to_i
+ yield(sourcerpm, filename, buildtime)
+ }
+ end
+
+ def test_old
+ # Package was built on this arch and src.rpm for new version is 15d old
+ setpackages(['foo-43-1.src.rpm:libfoo2-43-1.armv7hl.rpm:43', 'foo-42-1.src.rpm:libfoo1-42-1.armv7hl.rpm:42'])
+ srcages = {}
+ srcages['foo'] = [ 'foo-43-1.src.rpm', Time.now.to_i - 15*24*3600 ]
+ srcs = {}
+ srcs['foo-43-1.src.rpm'] = true
+ assert_equal(['libfoo1-42-1.armv7hl.rpm'], check_binaries('armv7hl', srcs, srcages, '', '', nil))
+ end
+
+ def test_recent
+ # Package was built on this arch but src.rpm for new version is only 1d old
+ setpackages(['foo-43-1.src.rpm:foo-43-1.armv7hl.rpm:43', 'foo-42-1.src.rpm:foo-42-1.armv7hl.rpm:42'])
+ srcages = {}
+ srcages['foo'] = [ 'foo-43.src.rpm', Time.now.to_i - 24*3600 ]
+ srcs = {}
+ srcs['foo-43-1.src.rpm'] = true
+ assert_equal([], check_binaries('armv7hl', srcs, srcages, '', '', nil))
+ end
+
+ def test_arm_late
+ # Package was not yet built on this arch
+ setpackages(['foo-42-1.src.rpm:foo-42-1.armv7hl.rpm:42'])
+ srcages = {}
+ srcages['foo'] = [ 'foo-43.src.rpm', Time.now.to_i - 24*3600 ]
+ srcs = {}
+ srcs['foo-43-1.src.rpm'] = true
+ assert_equal([], check_binaries('armv7hl', srcs, srcages, '', '', nil))
+ end
+
+ def test_multiple_versions
+ # Old package remains (usually happens to noarch due to youri bug)
+ $noarch = { 'foo' => true }
+ setpackages(['foo-42-1.src.rpm:foo-42-1.noarch.rpm:42', 'foo-42-2.src.rpm:foo-42-2.noarch.rpm:43'])
+ srcages = {}
+ srcages['foo'] = [ 'foo-42-2.src.rpm', Time.now.to_i - 24*3600 ]
+ srcs = {}
+ srcs['foo-42-2.src.rpm'] = true
+ assert_equal(['foo-42-1.noarch.rpm'], check_binaries('i586', srcs, srcages, '', '', nil))
+ end
+
+ def test_icu
+ $noarch = {}
+ now = Time.now.to_i
+ srctime = now - 3600
+ oldbintime = now - 10*24*3600
+ newbintime = now - 3200
+ setpackages([
+ "icu-71.1-2.mga9.src.rpm:icu71-data-71.1-2.mga9.noarch.rpm:#{oldbintime}",
+ "icu-71.1-2.mga9.src.rpm:lib64icu71-71.1-2.mga9.aarch64.rpm:#{oldbintime}",
+ "icu-72.1-1.mga9.src.rpm:icu72-data-72.1-1.mga9.noarch.rpm:#{newbintime}",
+ "icu-72.1-1.mga9.src.rpm:lib64icu-devel-72.1-1.mga9.aarch64.rpm:#{newbintime}",
+ "icu-72.1-1.mga9.src.rpm:lib64icu72-72.1-1.mga9.aarch64.rpm:#{newbintime}"
+ ])
+ srcages = {}
+ srcages['icu'] = [ 'icu-71.1-2.mga9.src.rpm', srctime ]
+ srcs = {}
+ srcs['icu-71.1-2.mga9.src.rpm'] = true
+ assert_equal([], check_binaries('aarch64', srcs, srcages, '', '', nil))
+ end
+
+end
diff --git a/modules/buildsystem/templates/iurt.conf b/modules/buildsystem/templates/iurt.conf
new file mode 100644
index 00000000..2dd8bf0e
--- /dev/null
+++ b/modules/buildsystem/templates/iurt.conf
@@ -0,0 +1,37 @@
+<%- distro = scope.lookupvar('buildsystem::var::distros::distros')[@distribution] -%>
+{
+ supported_arch => [ '<%= distro['arch'].join("', '") %>' ],
+ all_media =>{
+<%- distro['medias'].keys.sort.each{|media| -%>
+ '<%= media %>' => [ '<%=
+ distro['medias'][media]['repos'].keys.sort.join("', '") %>' ],
+<%-
+} -%>
+ },
+ distribution => '<%= distro['macros']['distribution'] %>',
+ vendor => '<%= distro['macros']['vendor'] %>',
+ base_media => [ '<%= distro['base_media'].join("', '") %>' ],
+ upload => '<%= build_login %>@pkgsubmit:~/uploads/',
+ upload_queue => '<%= build_login %>@pkgsubmit:~/uploads/queue/',
+ unwanted_packages => '^monotone-',
+ repository => 'http://<%= scope.lookupvar('buildsystem::var::repository::hostname') %>/<%= scope.lookupvar('buildsystem::var::repository::distribdir') %>/',
+ log_url => 'https://<%= scope.lookupvar('buildsystem::var::webstatus::hostname') %>/queue/build/',
+ admin => 'mageia-sysadm@mageia.org',
+ packager => 'Iurt the rebuild bot <mageia-sysadm@mageia.org>',
+ sendmail => 0,
+ log_size_limit => '600M',
+ build_timeout => {
+<%- build_timeout.keys.sort.each{|package| -%>
+ '<%= package %>' => <%= (build_timeout[package].to_f * scope.lookupvar('buildsystem::var::iurt::timeout_multiplier').to_f).to_i %>,
+<%-
+} -%>
+ },
+ use_netns => {
+ 'default' => 1,
+<%- allow_network_access.sort.each{|package| -%>
+ '<%= package %>' => 0,
+<%-
+} -%>
+ },
+}
+
diff --git a/modules/buildsystem/templates/iurt/1.conf b/modules/buildsystem/templates/iurt/1.conf
deleted file mode 100644
index 119ba666..00000000
--- a/modules/buildsystem/templates/iurt/1.conf
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- supported_arch => [ 'i586', 'x86_64' ],
- all_media => { 'core' => [ 'release' ], 'nonfree' => [ 'release' ], 'tainted' => [ 'release' ] },
- base_media => [ 'core/release' ],
- upload => '<%= build_login %>@pkgsubmit:~/uploads/',
- upload_queue => '<%= build_login %>@pkgsubmit:~/uploads/queue/',
- unwanted_packages => '^monotone-',
- repository => 'http://repository.<%= domain %>/distrib/',
- log_url => 'http://pkgsubmit.<%= domain %>/queue/build/',
- admin => 'mageia-sysadm@mageia.org',
- packager => 'Iurt the rebuild bot <mageia-sysadm@mageia.org>',
- sendmail => 0,
- build_timeout => {
- 'default' => 18000,
- 'gcc' => 57600,
- 'paraview' => 115200,
- 'salome' => 57600,
- 'itk' => 115200,
- 'wrapitk' => 115200,
- 'kernel-rt' => 57600,
- 'kernel-xen' => 57600,
- 'kernel-tmb' => 57600,
- 'openoffice.org' => 345600,
- 'openoffice.org64' => 345600,
- 'openoffice.org-go-ooo' => 345600,
- 'openoffice.org64-go-ooo' => 345600,
- 'libreoffice' => 345600
- },
-}
-
diff --git a/modules/buildsystem/templates/iurt/cauldron.conf b/modules/buildsystem/templates/iurt/cauldron.conf
deleted file mode 100644
index 119ba666..00000000
--- a/modules/buildsystem/templates/iurt/cauldron.conf
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- supported_arch => [ 'i586', 'x86_64' ],
- all_media => { 'core' => [ 'release' ], 'nonfree' => [ 'release' ], 'tainted' => [ 'release' ] },
- base_media => [ 'core/release' ],
- upload => '<%= build_login %>@pkgsubmit:~/uploads/',
- upload_queue => '<%= build_login %>@pkgsubmit:~/uploads/queue/',
- unwanted_packages => '^monotone-',
- repository => 'http://repository.<%= domain %>/distrib/',
- log_url => 'http://pkgsubmit.<%= domain %>/queue/build/',
- admin => 'mageia-sysadm@mageia.org',
- packager => 'Iurt the rebuild bot <mageia-sysadm@mageia.org>',
- sendmail => 0,
- build_timeout => {
- 'default' => 18000,
- 'gcc' => 57600,
- 'paraview' => 115200,
- 'salome' => 57600,
- 'itk' => 115200,
- 'wrapitk' => 115200,
- 'kernel-rt' => 57600,
- 'kernel-xen' => 57600,
- 'kernel-tmb' => 57600,
- 'openoffice.org' => 345600,
- 'openoffice.org64' => 345600,
- 'openoffice.org-go-ooo' => 345600,
- 'openoffice.org64-go-ooo' => 345600,
- 'libreoffice' => 345600
- },
-}
-
diff --git a/modules/buildsystem/templates/iurt/infra_1.conf b/modules/buildsystem/templates/iurt/infra_1.conf
deleted file mode 100644
index 5f41e9f2..00000000
--- a/modules/buildsystem/templates/iurt/infra_1.conf
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- supported_arch => [ 'i586', 'x86_64' ],
- all_media => { 'infra' => [ 'release' ] },
- base_media => [ 'base/core/release' ],
- upload => '<%= build_login %>@pkgsubmit:~/uploads/',
- upload_queue => '<%= build_login %>@pkgsubmit:~/uploads/queue/',
- repository => 'http://repository.<%= domain %>/distrib/',
- log_url => 'http://pkgsubmit.<%= domain %>/queue/build/',
- admin => 'mageia-sysadm@mageia.org',
- packager => 'Iurt the rebuild bot <mageia-sysadm@mageia.org>',
- sendmail => 0,
-}
-
diff --git a/modules/buildsystem/templates/iurt/mandriva2010.1.conf b/modules/buildsystem/templates/iurt/mandriva2010.1.conf
deleted file mode 100644
index 8779a17d..00000000
--- a/modules/buildsystem/templates/iurt/mandriva2010.1.conf
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- supported_arch => [ 'i586', 'x86_64' ],
- all_media => { 'main' => [ 'release' ], 'contrib' => [ 'release' ] },
- base_media => [ 'main/release' ],
- upload => '<%= build_login %>@pkgsubmit:~/uploads/',
- upload_queue => '<%= build_login %>@pkgsubmit:~/uploads/queue/',
- unwanted_packages => '^monotone-',
- repository => 'http://repository.<%= domain %>/mandriva/',
- rsync_to => '<%= build_login %>@pkgsubmit:/mnt/BIG/dis/uploads/build/',
- log_url => 'http://pkgsubmit.<%= domain %>/queue/build/',
- admin => 'mageia-sysadm@mageia.org',
- packager => 'Iurt the rebuild bot <mageia-sysadm@mageia.org>',
- sendmail => 0,
- build_timeout => {
- 'default' => 18000,
- 'gcc' => 57600,
- 'paraview' => 115200,
- 'salome' => 57600,
- 'itk' => 115200,
- 'wrapitk' => 115200,
- 'kernel-rt' => 57600,
- 'kernel-xen' => 57600,
- 'kernel-tmb' => 57600,
- 'openoffice.org' => 345600,
- 'openoffice.org64' => 345600,
- 'openoffice.org-go-ooo' => 345600,
- 'openoffice.org64-go-ooo' => 345600
- },
-}
-
diff --git a/modules/buildsystem/templates/iurt/sudoers.iurt b/modules/buildsystem/templates/iurt/sudoers.iurt
deleted file mode 100644
index 408aa92c..00000000
--- a/modules/buildsystem/templates/iurt/sudoers.iurt
+++ /dev/null
@@ -1 +0,0 @@
-<%= login %> ALL = NOPASSWD: /usr/sbin/iurt_root_command
diff --git a/modules/buildsystem/templates/iurt2010.1 b/modules/buildsystem/templates/iurt2010.1
deleted file mode 100755
index 44633e9b..00000000
--- a/modules/buildsystem/templates/iurt2010.1
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-if [ `whoami` != <%= build_login %> ]
-then
- echo 'this script should be run as <%= build_login %>' >&2
- exit 1
-fi
-ARCH=$(rpm --eval %_target_cpu)
-iurt --chrooted-urpmi -m contrib/release main/release ../../../2010.1-mgaserv/$ARCH -- http://repository.<%= domain %>/mandriva/ -r mandriva2010.1 $ARCH $@
diff --git a/modules/buildsystem/templates/maintdb/maintdb.bin b/modules/buildsystem/templates/maintdb/maintdb.bin
index b0cfb1ef..903ee009 100755
--- a/modules/buildsystem/templates/maintdb/maintdb.bin
+++ b/modules/buildsystem/templates/maintdb/maintdb.bin
@@ -1,30 +1,28 @@
-#!/bin/sh
+#!/bin/bash
-MAINTDBDIR="<%= dbdir %>"
+MAINTDBDIR="<%= scope.lookupvar('buildsystem::var::maintdb::dbdir') %>"
function checkname()
{
if [ -z "$1" ] ||
- echo "$1" | grep -q '[/*{}%]' ||
- echo "$1" | fgrep -q '..'
+ echo "$1" | grep -q '[/*{}%]' ||
+ echo "$1" | fgrep -q '..'
then
- echo "Error: invalid package name." >&2
- exit 1
+ echo "Error: invalid package name." >&2
+ exit 1
fi
}
function maintnew()
{
- if [ a"$user" != "aroot" ]
- then
- echo "Error: new is only allowed to root." >&2
- exit 1
+ if [ "$user" != "root" ]; then
+ echo "Error: new is only allowed to root." >&2
+ exit 1
fi
checkname "$1"
maintfile="$MAINTDBDIR/$1"
- if [ -f "$maintfile" ]
- then
- exit 0
+ if [ -f "$maintfile" ]; then
+ exit 0
fi
echo "$2" > "$maintfile"
}
@@ -34,79 +32,67 @@ function maintset()
checkname "$1"
maintfile="$MAINTDBDIR/$1"
newmaint="$2"
- if ! [ -f "$maintfile" ]
- then
- echo "Error: package $1 does not exist in maintdb." >&2
- exit 1
+ if [ ! -f "$maintfile" ]; then
+ echo "Error: package $1 does not exist in maintdb." >&2
+ exit 1
fi
curmaint=$(cat "$maintfile")
- if [ a"$newmaint" = "anobody" ]
- then
- if [ a"$curmaint" = a"$user" ]
- then
- echo "$newmaint" > "$maintfile"
- exit 0
- else
- echo "Error: cannot set maintainer for $1." >&2
- exit 1
- fi
- elif [ a"$newmaint" = a"$user" ]
- then
- if [ a"$curmaint" = "anobody" ]
- then
- echo "$newmaint" > "$maintfile"
- exit 0
- else
- echo "Error: cannot set maintainer for $1." >&2
- exit 1
- fi
+ if [ "$newmaint" = "nobody" ] || [[ "$newmaint" = *-team ]]; then
+ if [ "$curmaint" = "$user" ]; then
+ echo "$newmaint" > "$maintfile"
+ exit 0
+ else
+ echo "Error: cannot set maintainer for $1." >&2
+ exit 1
+ fi
+ elif [ "$newmaint" = "$user" ]; then
+ if [ "$curmaint" = "nobody" ] || [[ "$curmaint" = *-team ]]; then
+ echo "$newmaint" > "$maintfile"
+ exit 0
+ else
+ echo "Error: cannot set maintainer for $1." >&2
+ exit 1
+ fi
else
- echo "Error: cannot set someone else as maintainer." >&2
- exit 1
+ echo "Error: cannot set someone else as maintainer." >&2
+ exit 1
fi
}
function maintgetall()
{
cd "$MAINTDBDIR"
- for file in *
- do
- echo "$file $(cat $file)"
+ for file in *; do
+ echo "$file $(cat $file)"
done
exit 0
}
function maintget()
{
- if [ -z "$1" ]
- then
- maintgetall
+ if [ -z "$1" ]; then
+ maintgetall
fi
checkname "$1"
maintfile="$MAINTDBDIR/$1"
- if [ -f "$maintfile" ]
- then
- cat "$maintfile"
+ if [ -f "$maintfile" ]; then
+ cat "$maintfile"
else
- echo "Error: package $1 does not exist in maintdb." >&2
- exit 1
+ echo "Error: package $1 does not exist in maintdb." >&2
+ exit 1
fi
}
user="$1"
action="$2"
-if [ a"$action" = "anew" ]
-then
+if [ "$action" = "new" ]; then
maintnew "$3" "$4"
-elif [ a"$action" = "aset" ]
-then
+elif [ "$action" = "set" ]; then
maintset "$3" "$4"
-elif [ a"$action" = "aget" ]
-then
+elif [ "$action" = "get" ]; then
maintget "$3"
else
- echo "Error: unknow command." >&2
+ echo "Error: unknown command." >&2
exit 2
fi
-
diff --git a/modules/buildsystem/templates/maintdb/sudoers.maintdb b/modules/buildsystem/templates/maintdb/sudoers.maintdb
index 8dd19c42..91c88e47 100644
--- a/modules/buildsystem/templates/maintdb/sudoers.maintdb
+++ b/modules/buildsystem/templates/maintdb/sudoers.maintdb
@@ -1,2 +1,4 @@
-%<%= scope.lookupvar('buildsystem::base::packagers_group') %> ALL =(<%= login %>) NOPASSWD: <%= binpath %>
-<%= scope.lookupvar('buildsystem::base::sched_login') %> ALL =(<%= login %>) NOPASSWD: <%= binpath %>
+%<%= scope.lookupvar('buildsystem::var::groups::packagers') %> ALL =(<%= scope.lookupvar('buildsystem::var::maintdb::login') %>) NOPASSWD: <%= scope.lookupvar('buildsystem::var::maintdb::binpath') %> [a-z]* get
+%<%= scope.lookupvar('buildsystem::var::groups::packagers') %> ALL =(<%= scope.lookupvar('buildsystem::var::maintdb::login') %>) NOPASSWD: <%= scope.lookupvar('buildsystem::var::maintdb::binpath') %> [a-z]* [gs]et [a-zA-Z0-9]*
+%<%= scope.lookupvar('buildsystem::var::groups::packagers') %> ALL =(<%= scope.lookupvar('buildsystem::var::maintdb::login') %>) NOPASSWD: <%= scope.lookupvar('buildsystem::var::maintdb::binpath') %> [a-z]* set [a-zA-Z0-9]* [a-z]*
+<%= scope.lookupvar('buildsystem::var::scheduler::login') %> ALL =(<%= scope.lookupvar('buildsystem::var::maintdb::login') %>) NOPASSWD: <%= scope.lookupvar('buildsystem::var::maintdb::binpath') %> [a-z]* new [a-zA-Z0-9]* [a-z]*
diff --git a/modules/buildsystem/templates/maintdb/vhost_maintdb.conf b/modules/buildsystem/templates/maintdb/vhost_maintdb.conf
index 225c7215..146413a7 100644
--- a/modules/buildsystem/templates/maintdb/vhost_maintdb.conf
+++ b/modules/buildsystem/templates/maintdb/vhost_maintdb.conf
@@ -1,3 +1,3 @@
-<Directory <%= dbdir %>>
+<Directory <%= scope.lookupvar('buildsystem::var::maintdb::dbdir') %>>
Options None
</Directory>
diff --git a/modules/buildsystem/templates/maintdb/wrapper.maintdb b/modules/buildsystem/templates/maintdb/wrapper.maintdb
index 8420022d..fcf69dab 100644
--- a/modules/buildsystem/templates/maintdb/wrapper.maintdb
+++ b/modules/buildsystem/templates/maintdb/wrapper.maintdb
@@ -1,8 +1,8 @@
#!/bin/sh
-maintdbuser="<%= login %>"
-maintdbpath="<%= binpath %>"
-packagersgroup="<%= scope.lookupvar('buildsystem::base::packagers_group') %>"
+maintdbuser="<%= scope.lookupvar('buildsystem::var::maintdb::login') %>"
+maintdbpath="<%= scope.lookupvar('buildsystem::var::maintdb::binpath') %>"
+packagersgroup="<%= scope.lookupvar('buildsystem::var::groups::packagers') %>"
function isingroup()
{
@@ -22,5 +22,4 @@ then
exit 1
fi
-sudo -u "$maintdbuser" "$maintdbpath" $(whoami) $@
-
+sudo -u "$maintdbuser" "$maintdbpath" $(whoami) "$@"
diff --git a/modules/buildsystem/templates/media.cfg b/modules/buildsystem/templates/media.cfg
new file mode 100644
index 00000000..64757a2b
--- /dev/null
+++ b/modules/buildsystem/templates/media.cfg
@@ -0,0 +1,142 @@
+<%-
+def media_name(media, repo, type, archname)
+ name = [ media.capitalize ]
+ if archname != nil
+ name += [ archname ]
+ end
+ for r in repo.split('_') do
+ name += [ r.capitalize ]
+ end
+ if type != nil
+ name += [ type.capitalize ]
+ end
+ return name.join(' ')
+end
+
+def media_out(name, media_hash)
+ media_out = "[%s]\n" % name
+ media_hash.keys.sort.each{|key|
+ value = media_hash[key]
+ if value != nil
+ media_out += "%s=%s\n" % [ key, value ]
+ end
+ }
+ return media_out
+end
+distro = scope.lookupvar('buildsystem::var::distros::distros')[@distro_name]
+-%>
+[media_info]
+version=<%= distro['version'] %>
+mediacfg_version=2
+branch=<%= distro['branch'] %>
+<%-
+if @arch != 'armv7hl'
+-%>
+arch=<%= @arch %>
+<%-
+end
+-%>
+xml-info=1
+
+<%-
+distro['medias'].keys.sort { |x,y| distro['medias'][x]['order'] <=> distro['medias'][y]['order'] }.each{|medianame|
+ media = distro['medias'][medianame]
+ media['repos'].keys.sort { |x,y| media['repos'][x]['order'] <=> media['repos'][y]['order'] }.each{|reponame|
+ repo = media['repos'][reponame]
+ media_type = []
+ if media['media_type'] != nil
+ media_type += media['media_type']
+ end
+ if repo['media_type'] != nil
+ media_type += repo['media_type']
+ end
+ noauto=nil
+ if (media['noauto'] == '1') or (repo['noauto'] == '1')
+ noauto='1'
+ end
+ updates_for = nil
+ if repo['updates_for'] != nil
+ updates_for = [ medianame, repo['updates_for'] ].join('/')
+ end
+ -%><%=
+ media_out [ medianame, reponame ].join('/'),
+ :hdlist => [ 'hdlist', medianame, reponame ].join('_') + '.cz',
+ :name => media_name(medianame, reponame, nil, nil),
+ :srpms => [ '../../SRPMS', medianame, reponame ].join('/'),
+ :media_type => media_type.join(':'),
+ :updates_for => updates_for,
+ :noauto => noauto
+
+ %>
+ <%-# debug -%>
+ <%-
+ debug_media_type = media_type + [ 'debug' ]
+ -%><%=
+ media_out [ 'debug', medianame, reponame ].join('/'),
+ :hdlist => [ 'hdlist_debug', medianame, reponame ].join('_') + '.cz',
+ :name => media_name(medianame, reponame, 'debug', nil),
+ :srpms => [ '../../SRPMS', medianame, reponame ].join('/'),
+ :media_type => debug_media_type.join(':'),
+ :noauto => '1'
+
+ %>
+ <%-# source -%>
+ <%-
+ source_media_type = media_type + [ 'source' ]
+ -%><%=
+ media_out [ '../../SRPMS', medianame, reponame ].join('/'),
+ :hdlist => [ 'hdlist', medianame, reponame ].join('_') + '.src.cz',
+ :name => media_name(medianame, reponame, 'sources', nil),
+ :rpms => [ medianame, reponame ].join('/'),
+ :media_type => source_media_type.join(':'),
+ :noauto => '1'
+
+ %>
+ <%-# we add 32bit media if arch is x86_64 -%>
+ <%-
+ if @arch == 'x86_64' and distro['arch'].include?('i586')
+ medianame32 = [ medianame, '32' ].join('')
+ -%><%=
+ media_out [ '../../i586/media', medianame, reponame ].join('/'),
+ :hdlist => [ 'hdlist', medianame32, reponame ].join('_') + '.src.cz',
+ :name => media_name(medianame, reponame, nil, '32bit'),
+ :media_type => media_type.join(':'),
+ :noauto => noauto
+
+ %>
+ <%-
+ end
+ if @arch == 'x86_64' and distro['arch'].include?('i686')
+ medianame32 = [ medianame, '32' ].join('')
+ -%><%=
+ media_out [ '../../i686/media', medianame, reponame ].join('/'),
+ :hdlist => [ 'hdlist', medianame32, reponame ].join('_') + '.src.cz',
+ :name => media_name(medianame, reponame, nil, '32bit'),
+ :media_type => media_type.join(':'),
+ :noauto => noauto
+
+ %>
+ <%-
+ end
+ }
+}
+if distro['based_on'] != nil
+ distro['based_on'].keys.sort.each{|bdistroname|
+ bdistro = distro['based_on'][bdistroname]
+ bdistro.keys.sort.each{|medianame|
+ media = bdistro[medianame]
+ for reponame in media
+ -%><%=
+ media_out [ bdistroname, medianame, reponame ].join('/'),
+ :hdlist => [ 'hdlist', bdistroname, medianame,
+ reponame ].join('_'),
+ :name => media_name([ medianame, bdistroname].join(''), reponame, nil, nil),
+ :media_type => 'base_distro',
+ :noauto => 1
+ %>
+ <%-
+ end
+ }
+ }
+end
+-%>
diff --git a/modules/buildsystem/templates/mgacreatehome b/modules/buildsystem/templates/mgacreatehome
deleted file mode 100755
index 3c0fc140..00000000
--- a/modules/buildsystem/templates/mgacreatehome
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-
-# script to create home directory with ssh key
-# takes two arguments :
-# - login
-# - URL for ssh key
-
-test $# -eq 2 || exit 1
-login="$1"
-sshkeyurl="$2"
-sshkeyfile=`mktemp`
-homeroot='/home'
-
-id "$login" || exit 2
-wget -O "$sshkeyfile" "$sshkeyurl" || exit 2
-cat "$sshkeyfile"
-echo "Press enter to validate"
-read z
-
-test ! -d "$homeroot/$login" && cp -a /etc/skel "$homeroot/$login"
-mkdir "$homeroot/$login/.ssh"
-cat "$sshkeyfile" >> "$homeroot/$login/.ssh/authorized_keys"
-rm -f "$sshkeyfile"
-chmod 700 "$homeroot/$login/.ssh"
-chmod 600 "$homeroot/$login/.ssh/authorized_keys"
-chown -R "$login":mga-users "$homeroot/$login"
-
diff --git a/modules/buildsystem/templates/mgarepo.conf b/modules/buildsystem/templates/mgarepo.conf
index c6969c08..fbe5109c 100644
--- a/modules/buildsystem/templates/mgarepo.conf
+++ b/modules/buildsystem/templates/mgarepo.conf
@@ -1,25 +1,27 @@
+<%-
+ default_distro = scope.lookupvar('buildsystem::var::distros::default_distro')
+ distros = scope.lookupvar('buildsystem::var::distros::distros')
+-%>
[global]
verbose = no
-default_parent = svn://svn.<%= domain %>/svn/packages/cauldron
+default_parent = <%= scope.lookupvar('buildsystem::var::mgarepo::svn_root_packages') %>/<%= default_distro %>
#url-map = svn\+ssh://svn\.mageia\.org/(.*) file:///\1
tempdir = <%= sched_home_dir %>/repsys/tmp
-use-binaries-repository = yes
-binaries-repository = svn://svn.<%= domain %>/svn/binrepos
-# ldap settings
-# ldap is searched first: if not found, then [users] is read
-# if ldap search matched, then [users] is not consulted
-# if ldap is down, [users] is not consulted either
-#
-# we should have a generic fqdn here to use round-robin DNS
-# enhancement for repsys: support multiple ldap servers here
-ldap-server = ldap.<%= domain %>
-ldap-base = ou=People,<%= dc_suffix %>
-ldap-filterformat = (&(objectClass=inetOrgPerson)(uid=$username))
-ldap-resultformat = $cn <$mail>
-trunk-dir = cauldron
+trunk-dir = <%= default_distro %>
+<%-
+conf = scope.lookupvar('buildsystem::var::mgarepo::conf')
+if conf['global'] != nil
+ conf['global'].keys.sort.each{|key|
+ value = conf['global'][key]
+ -%><%= key %> = <%= value %>
+<%-
+ }
+end
+-%>
+
[log]
-oldurl = svn+ssh://svn.<%= domain %>/svn/packages/misc
+oldurl = <%= scope.lookupvar('buildsystem::var::mgarepo::oldurl') %>
# controls up to which revision the rpm changelog
# will be constructed (default zero, i.e., oldest
# commit)
@@ -28,48 +30,46 @@ oldurl = svn+ssh://svn.<%= domain %>/svn/packages/misc
ignore-string = SILENT
[template]
-path = /usr/share/repsys/default.chlog
+path = /usr/share/mgarepo/default.chlog
[users]
iurt = Mageia build bot <mageia-sysadm@<%= domain %>>
[submit]
-default = cauldron
-host = pkgsubmit.<%= domain %>
+default = <%= default_distro %>
+host = <%= scope.lookupvar('buildsystem::var::mgarepo::submit_host') %>
-[submit cauldron]
+<%-
+ distros.keys.sort.each{|d|
+ distro = distros[d]
+-%>
+[submit <%= d %>]
target = <%= sched_home_dir %>/repsys/srpms
-allowed = svn://svn.<%= domain %>/svn/packages/cauldron
-rpm-macros = global cauldron
+allowed = <%= distro['submit_allowed'] %> <%= distro['backports_allowed'] %>
+rpm-macros = global <%= d %>
-[submit 1]
-target = <%= sched_home_dir %>/repsys/srpms
-allowed = svn://svn.<%= domain %>/svn/packages/updates/1
-rpm-macros = global 1
-
-[submit infra_1]
-target = <%= sched_home_dir %>/repsys/srpms
-allowed = svn://svn.mageia.org/svn/packages/
-rpm-macros = global 1
+<%-
+ }
+-%>
[macros global]
-distsuffix = .mga
# mkrel definition to be removed when rpm-setup is updated on main build node
mkrel(c:) = %{-c: 0.%{-c*}.}%{1}%{?subrel:.%subrel}%{?distsuffix:%distsuffix}%{?!distsuffix:.mga}%{?distro_release:%distro_release}
-distribution = Mageia
-vendor = Mageia.Org
-_real_vendor = mageia
-
-[macros cauldron]
-distro_release = 2
-# 100 * major + minor
-mgaversion = 200
-mageia_branch = cauldron
+dist = %{?distsuffix:%distsuffix}%{?!distsuffix:.mga}%{?distro_release:%distro_release}
-[macros 1]
-distro_release = 1
-# 100 * major + minor
-mgaversion = 100
+<%-
+ distros.keys.sort.each{|d|
+ distro = distros[d]
+-%>
+[macros <%= d %>]
+distro_release = <%= distro['version'] %>
+<%-
+ distro['macros'].keys.sort.each{|macro|
+ value = distro['macros'][macro]
+ -%><%= macro %> = <%= value %>
+ <%- } %>
+<%- }
+%>
[helper]
create-srpm = /usr/share/repsys/create-srpm
@@ -82,6 +82,7 @@ upload-bin = /usr/local/bin/wrapper.upload-bin
run-prep = yes
[binrepo]
-download_url = http://binrepo.<%= domain %>/
-upload_host = binrepo.<%= domain %>
+<%- binrepo_hostname = scope.lookupvar('buildsystem::var::binrepo::hostname') -%>
+download_url = http://<%= binrepo_hostname %>/
+upload_host = <%= binrepo_hostname %>
diff --git a/modules/buildsystem/templates/repoctl.conf b/modules/buildsystem/templates/repoctl.conf
new file mode 100644
index 00000000..14506a25
--- /dev/null
+++ b/modules/buildsystem/templates/repoctl.conf
@@ -0,0 +1,40 @@
+<%-
+distribdir = scope.lookupvar('buildsystem::var::repository::distribdir')
+distros = scope.lookupvar('buildsystem::var::distros::distros')
+arches = {}
+distrosections = {}
+sectionsrepos = {}
+distros.each{|distroname, distro|
+ distro['medias'].each{|medianame, media|
+ distrosections[medianame] = 1
+ media['repos'].each{|reponame, repo|
+ sectionsrepos[reponame] = 1
+ }
+ }
+ distro['arch'].each{|arch|
+ arches[arch] = 1
+ }
+}
+-%>
+dryrun=echo
+if [ -z $SUDO_USER ]
+then
+ requestuser="$USER"
+else
+ requestuser="$SUDO_USER"
+fi
+lockdir=/var/lib/repoctl/locks
+hdlistsdir=/var/lib/repoctl/hdlists
+rootdir=<%= scope.lookupvar('buildsystem::var::repository::bootstrap_root') %>
+finalrootdir=<%= scope.lookupvar('buildsystem::var::repository::mirror_root') %>
+distribdir=$rootdir/<%= distribdir %>
+finaldistribdir=$finalrootdir/<%= distribdir %>
+distroreleases='<%= distros.keys.sort.join(' ') -%>'
+distrosections='<%= distrosections.keys.sort.join(' ') -%>'
+sectionsrepos='<%= sectionsrepos.keys.sort.join(' ') -%>'
+arches='<%= arches.keys.sort.join(' ') -%>'
+mirror_rsync_options="-v --delete -alH"
+timestampfile="mageia_timestamp"
+sha1sumfile="mageia_sha1sum"
+sha1sumsigfile="mageia_sha1sum.gpg"
+sign_mirror_sha1sum=/bin/true
diff --git a/modules/buildsystem/templates/signbot/sudoers.signpackage b/modules/buildsystem/templates/signbot/sudoers.signpackage
index 05653d30..4ea30238 100644
--- a/modules/buildsystem/templates/signbot/sudoers.signpackage
+++ b/modules/buildsystem/templates/signbot/sudoers.signpackage
@@ -1,2 +1,2 @@
-<%= sched_login %> ALL =(<%= login %>) NOPASSWD: /usr/local/bin/mga-signpackage
-<%= sched_login %> ALL =(<%= login %>) NOPASSWD: /usr/local/bin/sign-check-package
+<%= sched_login %> ALL =(<%= scope.lookupvar('buildsystem::var::signbot::login') %>) NOPASSWD: /usr/local/bin/mga-signpackage
+<%= sched_login %> ALL =(<%= scope.lookupvar('buildsystem::var::signbot::login') %>) NOPASSWD: /usr/local/bin/sign-check-package
diff --git a/modules/buildsystem/templates/submit_package.pl b/modules/buildsystem/templates/submit_package.pl
index daeec962..1fdf7749 100755
--- a/modules/buildsystem/templates/submit_package.pl
+++ b/modules/buildsystem/templates/submit_package.pl
@@ -2,8 +2,8 @@
use strict;
use warnings;
-my $svn_server = 'svn.<%= domain %>';
-my $packagersgroup="<%= packagers_group %>";
+my $svn_server = '<%= scope.lookupvar('buildsystem::var::mgarepo::svn_hostname') %>';
+my $packagersgroup="<%= scope.lookupvar('buildsystem::var::groups::packagers') %>";
my $login = getpwuid($<);
my (undef, undef, undef, $members) = getgrnam $packagersgroup;
diff --git a/modules/buildsystem/templates/sudoers.iurt b/modules/buildsystem/templates/sudoers.iurt
new file mode 100644
index 00000000..21e81e87
--- /dev/null
+++ b/modules/buildsystem/templates/sudoers.iurt
@@ -0,0 +1 @@
+<%= scope.lookupvar('buildsystem::var::iurt::login') %> ALL = NOPASSWD: /usr/sbin/iurt_root_command
diff --git a/modules/buildsystem/templates/sudoers.youri b/modules/buildsystem/templates/sudoers.youri
index f3fa35b0..3bc7cc2d 100644
--- a/modules/buildsystem/templates/sudoers.youri
+++ b/modules/buildsystem/templates/sudoers.youri
@@ -1,5 +1,6 @@
+<%- sched_login = scope.lookupvar('buildsystem::var::scheduler::login') -%>
Cmnd_Alias YOURI = /usr/local/bin/mga-youri-submit.wrapper
Defaults!YOURI always_set_home
Defaults!YOURI runas_default = <%= sched_login %>
Defaults!YOURI !requiretty
-%mga-packagers ALL = (<%= sched_login %>) NOPASSWD: YOURI
+%<%= scope.lookupvar('buildsystem::var::groups::packagers') -%> ALL = (<%= sched_login %>) NOPASSWD: YOURI
diff --git a/modules/buildsystem/templates/sync2010.1 b/modules/buildsystem/templates/sync2010.1
deleted file mode 100644
index 5f8eeebf..00000000
--- a/modules/buildsystem/templates/sync2010.1
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-
-if [ `whoami` != <%= sched_login %> ]
-then
- echo 'this script should be run as <%= sched_login %>' >&2
- exit 1
-fi
-
-cd /distrib/mandriva/2010.1-mgaserv || exit 1
-rsync -avH <%= build_login %>@jonund:/home/iurt/2010.1-SRPMS/ ./SRPMS
-
-for i in i586 x86_64; do
- mkdir -p $i
- cd $i
- rsync -avH <%= build_login %>@jonund:/home/iurt/iurt/mandriva2010.1/$i/*.rpm .
- ssh <%= build_login %>@jonund rm -f '/home/iurt/iurt/mandriva2010.1/$i/*.rpm'
- genhdlist2 .
- cd ..
-done
-
diff --git a/modules/buildsystem/templates/upload.conf b/modules/buildsystem/templates/upload.conf
index 99443831..af610c92 100644
--- a/modules/buildsystem/templates/upload.conf
+++ b/modules/buildsystem/templates/upload.conf
@@ -7,12 +7,20 @@
#
###
+<%-
+ build_nodes = scope.lookupvar('buildsystem::var::scheduler::build_nodes')
+-%>
my %nodes = (
- i586 => [ qw(jonund0 ecosse0 jonund1 ecosse1) ],
- x86_64 => [ qw(jonund0 ecosse0 jonund1 ecosse1) ],
+<%-
+ build_nodes.keys.sort.each{|arch|
+-%>
+ <%= arch -%> => [ '<%= build_nodes[arch].join("', '") -%>' ],
+<%-
+ }
+-%>
);
-my $repository = "http://repository.<%= domain %>/distrib/";
-my $homedir = "<%= homedir %>";
+my $repository = "http://<%= scope.lookupvar('buildsystem::var::repository::hostname') %>/<%= scope.lookupvar('buildsystem::var::repository::distribdir') %>/";
+my $homedir = "<%= scope.lookupvar('buildsystem::var::iurt::homedir') %>";
{
bot => {
@@ -23,7 +31,7 @@ my $homedir = "<%= homedir %>";
my $node = $_;
($node => {
iurt => {
- user => '<%= login %>',
+ user => '<%= scope.lookupvar('buildsystem::var::iurt::login') %>',
# (spuk, 2007-08-16) disabled iurt_cache additional media, locks trying to mount -o bind
# command => "iurt --copy-srpm --group -v 6 --config local_spool $homedir/iurt/__DIR__ --no_rsync --chrooted-urpmi -m __MEDIA__ -- $repository --additional-media -m __MEDIA__ -- file://$homedir/cache/ -p \"__PACKAGER__\" -r __TARGET__ __ARCH__",
command => "iurt --copy_srpm --group --rpmmacros \"%distro_section __SECTION__\" --config local_spool $homedir/iurt/__DIR__ --no_rsync --chrooted-urpmi -m __MEDIA__ -- $repository -p \"__PACKAGER__\" -r __TARGET__ __ARCH__",
@@ -35,39 +43,89 @@ my $homedir = "<%= homedir %>";
} keys %nodes),
},
media => {
- default => {
- "infra/release" => [ "infra/release", "base/core/updates", "base/core/release" ],
- "core/release" => [ "core/updates", "core/release" ],
- "core/updates" => [ "core/updates", "core/release" ],
- "core/updates_testing" => [ "core/updates_testing", "core/updates", "core/release" ],
- "core/backports" => [ "core/backports", "core/updates_testing", "core/updates", "core/release" ],
- "core/backports_testing" => [ "core/backports_testing", "core/backports", "core/updates_testing", "core/updates", "core/release" ],
- "nonfree/release" => [ "core/release", "nonfree/release" ],
- "nonfree/updates" => [ "core/updates", "core/release", "nonfree/release", "nonfree/updates" ],
- "nonfree/updates_testing" => [ "core/updates", "core/release", "core/updates_testing", "nonfree/release", "nonfree/updates", "nonfree/updates_testing" ],
- "nonfree/backports" => [ "core/backports", "core/updates_testing", "core/updates", "core/release",
- "nonfree/release", "nonfree/updates", "nonfree/updates_testing", "nonfree/backports" ],
- "nonfree/backports_testing" => [ "core/backports_testing", "core/backports", "core/updates_testing", "core/updates", "core/release",
- "nonfree/release", "nonfree/updates", "nonfree/updates_testing", "nonfree/backports", "nonfree/backports_testing" ],
- "tainted/release" => [ "core/release", "nonfree/release", "tainted/release" ],
- "tainted/updates" => [ "core/release", "nonfree/release", "tainted/release",
- "core/updates", "nonfree/updates", "tainted/updates" ],
- "tainted/updates_testing" => [ "core/release", "nonfree/release", "tainted/release",
- "core/updates", "nonfree/updates", "tainted/updates",
- "core/updates_testing", "nonfree/updates_testing", "tainted/updates_testing" ],
- "tainted/backports" => [ "core/release", "nonfree/release", "tainted/release",
- "core/updates", "nonfree/updates", "tainted/updates",
- "core/updates_testing", "nonfree/updates_testing", "tainted/updates_testing",
- "core/backports", "nonfree/backports", "tainted/backports" ],
- "tainted/backports_testing" => [ "core/release", "nonfree/release", "tainted/release",
- "core/updates", "nonfree/updates", "tainted/updates",
- "core/updates_testing", "nonfree/updates_testing", "tainted/updates_testing",
- "core/backports", "nonfree/backports", "tainted/backports",
- "core/backports_testing", "nonfree/backports_testing", "tainted/backports_testing" ],
- },
+ <%-
+ def repo_deps(distros, dname, mname, rname)
+ deps = {}
+ distro = distros[dname]
+ if distro['based_on'] != nil
+ distro['based_on'].each{|bdistro, bmedias|
+ if bmedias[mname] != nil and \
+ bmedias[mname].include?(rname) then
+ deps[ [ bdistro, mname, rname ].join('/') ] = 1
+ end
+ }
+ end
+ if distro['medias'][mname] != nil \
+ and distro['medias'][mname]['repos'][rname] != nil
+ then
+ deps[ [ mname, rname ].join('/') ] = 1
+ else
+ return deps
+ end
+ mlist = distro['medias'][mname]['requires']
+ mlist = mlist == nil ? [ mname ] : [ mname ] + mlist
+ mlist.each{|mreq|
+ rlist = distro['medias'][mname]['repos'][rname]['requires']
+ rlist = [] if rlist == nil
+ rlist += [ rname ] if mreq != mname
+ rlist.each{|rreq|
+ deps.merge!(repo_deps(distros, dname, mreq, rreq))
+ }
+ }
+ return deps
+ end
+ distros = scope.lookupvar('buildsystem::var::distros::distros')
+ distros.keys.sort.each{|distroname|
+ -%>
+ '<%= distroname -%>' => {
+ <%-
+ distro = distros[distroname]
+ distro['medias'].keys.sort.each{|medianame|
+ media = distro['medias'][medianame]
+ media['repos'].keys.sort.each{|reponame|
+ deps = repo_deps(distros, distroname, medianame, reponame)
+ -%>
+ "<%= [ medianame, reponame ].join('/') %>" => [ "<%=
+ deps.keys.sort.join('", "')
+ %>" ],
+ <%-
+ }
+ }
+ -%>
+ },
+ <%-
+ }
+ -%>
},
- admin => 'mageia-sysadm@mageia.org',
- http_queue => 'http://pkgsubmit.<%= domain %>/uploads',
- upload_user => '<%= sched_login %>',
+ admin => '<%= scope.lookupvar('buildsystem::var::scheduler::admin_mail') %>',
+ http_queue => 'https://<%= scope.lookupvar('buildsystem::var::webstatus::hostname') %>/uploads',
+ upload_user => '<%= scope.lookupvar('buildsystem::var::scheduler::login') %>',
email_domain => '<%= domain %>',
+ arch => {
+ <%-
+ distros.keys.sort.each{|distroname|
+ -%>
+ <%= distroname -%> => [ '<%= distros[distroname]['arch'].join("', '") %>' ],
+ <%-
+ }
+ -%>
+ default => [ 'i586', 'x86_64' ],
+ },
+ mandatory_arch => {
+ <%-
+ distros.keys.sort.each{|distroname|
+ if distros[distroname]['mandatory_arch'] != nil
+ march = distros[distroname]['mandatory_arch']
+ else
+ march = distros[distroname]['arch']
+ end
+ -%>
+ <%= distroname -%> => [ '<%= march.join("', '") %>' ],
+ <%-
+ }
+ -%>
+ default => [ 'i586', 'x86_64' ],
+ },
+ ssh_options => "-o ServerAliveInterval=10 -o ConnectTimeout=20 -o BatchMode=yes",
+ faildelay => 360000,
}
diff --git a/modules/buildsystem/templates/vhost_pkgsubmit.conf b/modules/buildsystem/templates/vhost_pkgsubmit.conf
deleted file mode 100644
index af8bb70c..00000000
--- a/modules/buildsystem/templates/vhost_pkgsubmit.conf
+++ /dev/null
@@ -1,4 +0,0 @@
-<Location /uploads>
- Allow from all
- Options Indexes
-</Location>
diff --git a/modules/buildsystem/templates/vhost_repository.conf b/modules/buildsystem/templates/vhost_repository.conf
index 50d42b3b..e082ffca 100644
--- a/modules/buildsystem/templates/vhost_repository.conf
+++ b/modules/buildsystem/templates/vhost_repository.conf
@@ -1,50 +1,73 @@
-<%
-# FIXME: add a reverse lookup for IPv6 adresses
-# allowed hosts are: valstar, ecosse, jonund
-buildsystem_nodes = "2a02:2178:2:7::3/64 2a02:2178:2:7::4/64 2a02:2178:2:7::5/64"
-%>
-
+<%-
+mirror_root = scope.lookupvar('buildsystem::var::repository::mirror_root')
+mirror_reporoot = scope.lookupvar('buildsystem::var::repository::mirror_reporoot')
+bootstrap_reporoot = scope.lookupvar('buildsystem::var::repository::bootstrap_reporoot')
+distribdir = scope.lookupvar('buildsystem::var::repository::distribdir')
+repo_allow_from_ips = scope.lookupvar('buildsystem::var::distros::repo_allow_from_ips')
+repo_allow_from_domains = scope.lookupvar('buildsystem::var::distros::repo_allow_from_ips')
+distros = scope.lookupvar('buildsystem::var::distros::distros')
+-%>
<VirtualHost *:80>
- ServerName repository.<%= domain %>
+ ServerName <%= scope.lookupvar('buildsystem::var::repository::hostname') %>
DocumentRoot <%= mirror_root %>
- Alias /distrib/infra_1/ "/distrib/bootstrap/distrib/infra_1/"
- Alias /mandriva/ "/distrib/mandriva/"
- Alias /mageiatools/ "/distrib/mageiatools/"
- <Directory <%= mirror_root %>>
- Order deny,allow
- Deny from all
- Allow from localhost, 127.0.0.1
- Allow from <%= buildsystem_nodes %>
- Allow from .<%= domain %>
- Options Indexes FollowSymLinks
- </Directory>
+ # Some simple API to check existence of SRPMs for QA
+ RewriteEngine On
- <Directory /distrib/bootstrap/distrib/infra_1>
- Header append Cache-Control "public, must-revalidate"
- Order deny,allow
- Allow from all
- Options Indexes FollowSymLinks
- </Directory>
+ RewriteCond /distrib/bootstrap/distrib/$2/SRPMS/$3/$1s_testing/$4.src.rpm -f
+ RewriteRule ^/qa/checksrpm/(update|backport)/([1-9][0-9]*)/([a-z_]+)/([^/]+)$ http://repository.mageia.org/qa/checksrpm/found [L,R=302]
- <Directory /distrib/mandriva>
- Order deny,allow
- Deny from all
- Allow from localhost, 127.0.0.1
- Allow from <%= buildsystem_nodes %>
- Allow from .<%= domain %>
- Options Indexes FollowSymLinks
- </Directory>
-
- <Directory /distrib/mandriva/2010.1-mgaserv/>
- Order deny,allow
- Allow from all
+ RewriteRule ^/qa/checksrpm/ - [L,G]
+
+<%-
+ if repo_allow_from_ips != nil || repo_allow_from_domains != nil then
+ access_requires = [ 'all denied' ]
+ if repo_allow_from_ips != nil then
+ for allow in repo_allow_from_ips do
+ access_requires << 'ip ' + allow
+ end
+ end
+ if repo_allow_from_domains != nil then
+ for allow in repo_allow_from_domains do
+ access_requires << 'host ' + allow
+ end
+ end
+ else
+ access_requires = [ 'all granted' ]
+ end
+%>
+ Alias /bootstrap/ "<%= bootstrap_reporoot %>/"
+<%-
+ distros.keys.sort.each{|distroname|
+ distro = distros[distroname]
+ if distro['no_mirror'] -%>
+ Alias /<%= distribdir %>/<%= distroname %>/ "<%= bootstrap_reporoot %>/<%= distroname %>/"
+<%-
+ end
+ }
+-%>
+
+ <Directory <%= bootstrap_reporoot %>>
+ Header append Cache-Control "public, must-revalidate"
+<%-
+ for req in access_requires do
+-%>
+ Require <%= req %>
+<%-
+ end
+-%>
Options Indexes FollowSymLinks
</Directory>
- <Directory /distrib/mageiatools>
- Order deny,allow
- Allow from all
+ <Directory <%= mirror_root %>>
+ Header append Cache-Control "public, must-revalidate"
+<%-
+ for req in access_requires do
+-%>
+ Require <%= req %>
+<%-
+ end
+-%>
Options Indexes FollowSymLinks
</Directory>
</VirtualHost>
diff --git a/modules/buildsystem/templates/vhost_webstatus.conf b/modules/buildsystem/templates/vhost_webstatus.conf
new file mode 100644
index 00000000..3b0e6246
--- /dev/null
+++ b/modules/buildsystem/templates/vhost_webstatus.conf
@@ -0,0 +1,13 @@
+<Location /uploads>
+ Require all granted
+ Options Indexes
+ IndexOptions NameWidth=*
+</Location>
+<Location /autobuild>
+ Require all granted
+ Options Indexes
+ IndexOptions NameWidth=*
+</Location>
+<Directory /var/www/bs/autobuild>
+ Options FollowSymlinks FollowSymLinks
+</Directory>
diff --git a/modules/buildsystem/templates/youri/host.conf b/modules/buildsystem/templates/youri/host.conf
new file mode 100644
index 00000000..bf4fa086
--- /dev/null
+++ b/modules/buildsystem/templates/youri/host.conf
@@ -0,0 +1,23 @@
+<%-
+ aliases = scope.lookupvar('buildsystem::var::scheduler::build_nodes_aliases')
+ nodes = {}
+ nodes['src'] = [ scope.lookupvar('buildsystem::var::scheduler::build_src_node') ]
+ scope.lookupvar('buildsystem::var::scheduler::build_nodes').each{|arch,n|
+ a = arch + '|noarch|src'
+ nodes[a] = []
+ n.each{|node|
+ if aliases[node] != nil
+ nodes[a] += [ aliases[node] ]
+ else
+ nodes[a] += [ node ]
+ end
+ }
+ }
+ str = ''
+ nodes.keys.sort.each{|arch|
+ nodes[arch].sort.uniq.each{|node|
+ str += node + ' ' + arch + "\n"
+ }
+ }
+-%>
+<%= str -%>
diff --git a/modules/buildsystem/templates/youri/submit-todo.conf b/modules/buildsystem/templates/youri/submit-todo.conf
deleted file mode 100644
index 3bfb69cf..00000000
--- a/modules/buildsystem/templates/youri/submit-todo.conf
+++ /dev/null
@@ -1,186 +0,0 @@
-<%
-escaped_domain = domain.gsub('.','\.')
-%>
-
-home: <%= sched_home_dir %>
-
-# repository declaration
-repository:
- class: Youri::Repository::Mageia
- options:
- install_root: <%= repository_root %>/distrib
- upload_root: ${home}/uploads/
- upload_state: todo done queue
- queue: todo
- noarch: i586
- svn: svn+ssh://svn.<%= domain %>/svn/packages/cauldron/
- 1:
- arch: i586 x86_64
- infra_1:
- arch: i586 x86_64
- cauldron:
- arch: i586 x86_64
-
-# targets definition
-targets:
- cauldron:
- checks:
- - source
- - deps
- - version
- #- svn
- - tag
- - acl
- - host
- #- section
- - rpmlint
- - recency
- #- history
- - queue_recency
- actions:
- - send
- - rpminfo
-
- 1:
- checks:
- - source
- - version
- #- svn
- - tag
- - acl
- - host
- #- section
- - rpmlint
- - recency
- #- history
- - queue_recency
- actions:
- - send
- - rpminfo
- - ulri
-
- infra_1:
- checks:
- - source
- - version
- - tag
- - acl
- - rpmlint
- - recency
- - queue_recency
- actions:
- - send
- - rpminfo
- - ulri
-
-# checks definition
-checks:
- tag:
- class: Youri::Submit::Check::Tag
- options:
- tags:
- release: 'mga\d+'
- # packager: '<\S+@<%= escaped_domain %>>$'
- distribution: '^Mageia'
- vendor: '^Mageia.Org$'
-
- recency:
- class: Youri::Submit::Check::Recency
-
- queue_recency:
- class: Youri::Submit::Check::Queue_recency
-
- host:
- class: Youri::Submit::Check::Host
- options:
- host_file: /etc/youri/host.conf
-
- section:
- class: Youri::Submit::Check::Section
-
- rpmlint:
- class: Youri::Submit::Check::Rpmlint
- options:
- config: /etc/rpmlint/config
- results:
- - buildprereq-use
- - no-description-tag
- - no-summary-tag
- - non-standard-group
- - non-xdg-migrated-menu
- # it breaks dbus
- #- patch-not-applied
- - percent-in-conflicts
- - percent-in-dependency
- - percent-in-obsoletes
- - percent-in-provides
- - summary-ended-with-dot
- - invalid-spec-name
- - noarch-python-in-64bit-path
- svn:
- class: Youri::Submit::Check::SVN
-
- acl:
- class: Youri::Submit::Check::ACL
- options:
- acl_file: /etc/youri/acl.conf
-
- history:
- class: Youri::Submit::Check::History
-
- source:
- class: Youri::Submit::Check::Source
-
- precedence:
- class: Youri::Submit::Check::Precedence
- options:
- target: cauldron
-
- version:
- class: Youri::Submit::Check::Version
- options:
- 1:
- authorized_packages: none_package_authorized
- authorized_sections: ^(core|nonfree|tainted)/(updates_testing|backports|backports_testing)$
- authorized_arches: none
- mode: freeze
-
- cauldron:
- authorized_sections: ^[a-z]+/updates_testing$
- authorized_packages: ^$
- authorized_arches: none
- authorized_users: ^<%= scope.function_group_members(['mga-release_managers']).join('|') %>$
-# mode: normal
- mode: version_freeze
-# mode: freeze
-
- deps:
- class: Youri::Submit::Check::Deps
-
-# actions definitions
-actions:
- send:
- class: Youri::Submit::Action::Send
- options:
- user: <%= sched_login %>
- keep_svn_release: yes
- uphost: pkgsubmit.<%= domain %>
- root: ${home}/uploads
- ssh_key: ${home}/.ssh/id_rsa
-
- rpminfo:
- class: Youri::Submit::Action::Rpminfo
- options:
- user: <%= sched_login %>
- uphost: pkgsubmit.<%= domain %>
- root: ${home}/uploads
- ssh_key: ${home}/.ssh/id_rsa
-
- ulri:
- class: Youri::Submit::Action::Ulri
- options:
- user: <%= sched_login %>
- uphost: pkgsubmit.<%= domain %>
- ssh_key: ${home}/.ssh/id_rsa
-
-# vim:ft=yaml:et:sw=4
diff --git a/modules/buildsystem/templates/youri/submit-upload.conf b/modules/buildsystem/templates/youri/submit-upload.conf
deleted file mode 100644
index 93195369..00000000
--- a/modules/buildsystem/templates/youri/submit-upload.conf
+++ /dev/null
@@ -1,332 +0,0 @@
-<%
-Puppet::Parser::Functions.autoloader.loadall
-escaped_domain = domain.gsub('.','\.')
-%>
-
-home: <%= sched_home_dir %>
-
-# repository declaration
-repository:
- class: Youri::Repository::Mageia
- options:
- install_root: <%= repository_root %>/distrib
- upload_root: ${home}/uploads/
- archive_root: <%= packages_archivedir %>
- upload_state: queue
- queue: queue
- noarch: i586
- svn: svn+ssh://svn.<%= domain %>/svn/packages/cauldron/
- 1:
- arch: i586 x86_64
- infra_1:
- arch: i586 x86_64
- cauldron:
- arch: i586 x86_64
-
-# targets definition
-targets:
- cauldron:
- checks:
- - version
- - tag
- - acl
- - rpmlint
- - recency
- actions:
- - markrelease
- - sign
- - install
- - link
- - unpack_release_notes
- - unpack_gfxboot_theme
- - unpack_meta_task
- - unpack_installer_images
- - unpack_installer_images_nonfree
- - unpack_installer_stage2
- - unpack_installer_advertising
- - unpack_installer_rescue
- - unpack_rpmlint_config
-# - dkms_module_info
- - archive
- - mail
- - maintdb
- posts:
- - genhdlist2
- - clean_rpmsrate
- - mirror
-
- 1:
- checks:
- - version
- - tag
- - acl
- - rpmlint
- - recency
- actions:
-# - markrelease
- - sign
- - install
- - link
-# - unpack_release_notes
-# - unpack_gfxboot_theme
-# - unpack_meta_task
-# - unpack_installer_images
-# - unpack_installer_stage2
-# - unpack_installer_advertising
-# - unpack_installer_rescue
-# - dkms_module_info
- - archive
- - mail
-# - maintdb
- posts:
- - genhdlist2
- - clean_rpmsrate
- - mirror
-
- infra_1:
- checks:
- - version
- - tag
- - acl
- - rpmlint
- - recency
- actions:
- - sign
- - install
- - link
- - archive
- posts:
- - genhdlist2
-
-# checks definition
-checks:
- tag:
- class: Youri::Submit::Check::Tag
- options:
- tags:
- release: 'mga\d+'
- # packager: '<\S+@<%= escaped_domain %>>$'
- distribution: '^Mageia'
- vendor: '^Mageia.Org$'
-
- recency:
- class: Youri::Submit::Check::Recency
-
- queue_recency:
- class: Youri::Submit::Check::Queue_recency
-
- host:
- class: Youri::Submit::Check::Host
- options:
- host_file: /etc/youri/host.conf
-
- section:
- class: Youri::Submit::Check::Section
-
- rpmlint:
- class: Youri::Submit::Check::Rpmlint
- options:
- config: /etc/rpmlint/config
- results:
- - buildprereq-use
- - no-description-tag
- - no-summary-tag
- - non-standard-group
- - non-xdg-migrated-menu
- # it breaks dbus
- #- patch-not-applied
- - percent-in-conflicts
- - percent-in-dependency
- - percent-in-obsoletes
- - percent-in-provides
- - summary-ended-with-dot
- - unexpanded-macro
- - unknown-lsb-keyword
- - malformed-line-in-lsb-comment-block
- - empty-%postun
- - empty-%post
- - invalid-desktopfile
- - standard-dir-owned-by-package
- - use-tmp-in-%postun
- - bogus-variable-use-in-%posttrans
- - dir-or-file-in-usr-local
- - dir-or-file-in-tmp
- - dir-or-file-in-mnt
- - dir-or-file-in-opt
- - dir-or-file-in-home
- - dir-or-file-in-var-local
- svn:
- class: Youri::Submit::Check::SVN
-
- acl:
- class: Youri::Submit::Check::ACL
- options:
- acl_file: /etc/youri/acl.conf
-
- history:
- class: Youri::Submit::Check::History
-
- source:
- class: Youri::Submit::Check::Source
-
- precedence:
- class: Youri::Submit::Check::Precedence
- options:
- target: cauldron
-
- version:
- class: Youri::Submit::Check::Version
- options:
- 1:
- authorized_packages: none_package_authorized
- authorized_sections: ^(debug/)?(core|nonfree|tainted)/(updates_testing|backports_testing)$
- authorized_arches: none
- mode: freeze
-
- infra_1:
- authorized_users: ^<%= scope.function_group_members(['mga-sysadmin']).join('|') %>$
- mode: freeze
-
- cauldron:
-# <mrl> Prior freeze
- mode: normal
-## <blino> Version freeze
-# authorized_packages: ^$
-# authorized_sections: ^(debug/)?(core|nonfree|tainted)/updates_testing$
-# authorized_arches: ^$
-# authorized_users: ^blino|ennael|nvigier$
-# mode: version_freeze
-# <mrl> Freeze config
-# authorized_packages: ^mdkonline|drakxtools|urpmi|ia_ora-gnome|ldetect|ldetect-lst|rpm-mageia-setup|perl-MDK-Common$
-# authorized_packages: none_package_authorized
-# authorized_sections: ^restricted/release|main/updates_testing|contrib/updates_testing$
-# authorized_arches: none
-# authorized_users: ^blino|ennael|nvigier$
-# mode: freeze
-
-# actions definitions
-actions:
- install:
- class: Youri::Submit::Action::Install
-
- markrelease:
- class: Youri::Submit::Action::Markrelease
-
- link:
- class: Youri::Submit::Action::Link
-
- archive:
- class: Youri::Submit::Action::Archive
-
- clean:
- class: Youri::Submit::Action::Clean
-
- sign:
- class: Youri::Submit::Action::Sign
- options:
- signuser: <%= scope.lookupvar('buildsystem::signbot::login') %>
- path: <%= scope.lookupvar('buildsystem::signbot::sign_keydir') %>
- name: <%= scope.lookupvar('buildsystem::signbot::keyid') %>
- signscript: /usr/local/bin/sign-check-package
-
- unpack_gfxboot_theme:
- class: Youri::Submit::Action::Unpack
- options:
- name: mageia-gfxboot-theme
- source_subdir: /usr/share/gfxboot/themes/Mageia/install/
- dest_directory: isolinux
- unpack_inside_distribution_root: 1
-
- unpack_meta_task:
- class: Youri::Submit::Action::Unpack
- options:
- name: meta-task
- source_subdir: /usr/share/meta-task
- dest_directory: media/media_info
- unpack_inside_distribution_root: 1
-
- unpack_installer_images:
- class: Youri::Submit::Action::Unpack
- options:
- name: drakx-installer-images
- source_subdir: /usr/lib*/drakx-installer-images
- dest_directory: .
- preclean_directory: install/images/alternatives
- unpack_inside_distribution_root: 1
-
- unpack_installer_images_nonfree:
- class: Youri::Submit::Action::Unpack
- options:
- name: drakx-installer-images-nonfree
- source_subdir: /usr/lib*/drakx-installer-images
- dest_directory: .
- unpack_inside_distribution_root: 1
-
- unpack_installer_stage2:
- class: Youri::Submit::Action::Unpack
- options:
- name: drakx-installer-stage2
- source_subdir: /usr/lib*/drakx-installer-stage2
- dest_directory: .
- unpack_inside_distribution_root: 1
-
- unpack_installer_advertising:
- class: Youri::Submit::Action::Unpack
- options:
- name: drakx-installer-advertising
- source_subdir: /usr/share/drakx-installer-advertising
- dest_directory: .
- unpack_inside_distribution_root: 1
-
- unpack_installer_rescue:
- class: Youri::Submit::Action::Unpack
- options:
- name: drakx-installer-rescue
- source_subdir: /usr/lib*/drakx-installer-rescue
- dest_directory: install/stage2
- unpack_inside_distribution_root: 1
-
- unpack_release_notes:
- class: Youri::Submit::Action::Unpack
- options:
- name: mageia-release-common
- source_subdir: /usr/share/doc/mageia-release-common
- grep_files: release-notes.*
- dest_directory: .
- unpack_inside_distribution_root: 1
-
- unpack_rpmlint_config:
- class: Youri::Submit::Action::Unpack
- options:
- name: rpmlint-mageia-policy
- source_subdir: /usr/share/rpmlint/config.d/
- grep_files: distribution.*
- dest_directory: /etc/rpmlint/extracted.d/
- unpack_inside_distribution_root: 0
-
- mail:
- class: Youri::Submit::Action::Mail
- options:
- mta: /usr/sbin/sendmail
- to: changelog@ml.<%= domain %>
- reply_to: mageia-dev@<%= domain %>
- from: buildsystem-daemon@<%= domain %>
- prefix: RPM
-
- maintdb:
- class: Youri::Submit::Action::UpdateMaintDb
- options:
-
-posts:
- genhdlist2:
- class: Youri::Submit::Post::Genhdlist2
- options:
- command: /usr/bin/genhdlist2
- clean_rpmsrate:
- class: Youri::Submit::Post::CleanRpmsrate
- mirror:
- class: Youri::Submit::Post::Mirror
- options:
- destination: /distrib/mirror/distrib
-
-# vim:ft=yaml:et:sw=4
diff --git a/modules/buildsystem/templates/youri/submit.conf b/modules/buildsystem/templates/youri/submit.conf
new file mode 100644
index 00000000..0d7cf927
--- /dev/null
+++ b/modules/buildsystem/templates/youri/submit.conf
@@ -0,0 +1,140 @@
+<%
+Puppet::Parser::Functions.autoloader.loadall
+sched_home_dir = scope.lookupvar('buildsystem::var::scheduler::homedir')
+
+conf = scope.lookupvar('buildsystem::var::youri::youri_conf')
+conf_default = scope.lookupvar('buildsystem::var::youri::youri_conf_default')
+distros = scope.lookupvar('buildsystem::var::distros::distros')
+
+def line(text, indent)
+ res = ''
+ i = 0
+ while i < indent
+ res += ' '
+ i += 1
+ end
+ res += text + "\n"
+end
+
+def array_text(array, indent)
+ res = ''
+ array.each{|a|
+ res += line('- ' + a, indent)
+ }
+ return res
+end
+
+def hash_text(hash, indent)
+ res = ''
+ curindent = indent
+ hash.keys.sort.each{|key|
+ if hash[key].instance_of? Hash
+ res += line(key + ':', indent)
+ res += hash_text(hash[key], indent + 4)
+ elsif hash[key].instance_of? Array
+ res += line(key + ':', indent)
+ res += array_text(hash[key], indent + 4)
+ elsif hash[key].instance_of? String
+ res += line(key + ': ' + hash[key], indent)
+ end
+ }
+ return res
+end
+
+def class_hash(conf, conf_default)
+ res = {}
+ res['class'] = get_conf(conf, ['class']) == nil ?
+ conf_default['class'] : conf['class']
+ res['options'] = get_conf(conf_default, ['options']) == nil ? {} :
+ conf_default['options'].dup
+ if get_conf(conf, ['options']) != nil
+ res['options'].merge!(conf['options'])
+ end
+ return res
+end
+
+def get_conf(conf, path)
+ res = conf
+ path.each{|p|
+ if res == nil
+ return nil
+ end
+ res = res[p]
+ }
+ return res
+end
+
+def get_distros_conf(distros, conf_name, path)
+ res = {}
+ distros.keys.each{|distro|
+ t = get_conf(distros[distro], [ 'youri', conf_name ] + path)
+ if t != nil
+ res[distro] = t.dup
+ end
+ }
+ return res
+end
+
+def get_definitions(def_name, conf_name, conf, conf_default, distros)
+ res = {}
+ res[def_name] = {}
+ def_list = conf_default[conf_name][def_name].keys
+ def_list += get_conf(conf, [ conf_name, def_name ]) != nil ? \
+ conf[conf_name][def_name].keys : []
+ def_list.uniq.each{|d|
+ res[def_name][d] = class_hash(
+ get_conf(conf, [ conf_name, def_name, d ]),
+ get_conf(conf_default, [ conf_name, def_name, d ])
+ )
+ res[def_name][d]['options'].merge!(get_distros_conf(distros,
+ conf_name, [ def_name, d ]))
+ }
+ return res
+end
+
+%>
+home: <%= sched_home_dir %>
+
+<%-
+ repository = {
+ 'repository' => class_hash(get_conf(conf[conf_name],
+ ['repository']),
+ conf_default[conf_name]['repository']),
+ }
+ distros.keys.each{|distro|
+ repository['repository']['options'][distro] = {
+ 'arch' => distros[distro]['arch'].join(' '),
+ }
+ }
+-%>
+# repository declaration
+<%= hash_text(repository, 0) %>
+
+<%-
+ targets = {
+ 'targets' => get_distros_conf(distros, conf_name, [ 'targets' ]),
+ }
+-%>
+# targets definition
+<%= hash_text(targets, 0) %>
+
+<%-
+ checks = get_definitions('checks', conf_name, conf, conf_default, distros)
+-%>
+# checks definition
+<%= hash_text(checks, 0) -%>
+
+<%-
+ actions = get_definitions('actions', conf_name, conf, conf_default, distros)
+-%>
+# actions definitions
+<%= hash_text(actions, 0) -%>
+
+<%-
+ posts = get_definitions('posts', conf_name, conf, conf_default, distros)
+-%>
+
+# posts definitions
+<%= hash_text(posts, 0) -%>
+
+# vim:ft=yaml:et:sw=4