diff options
Diffstat (limited to 'modules/buildsystem')
-rw-r--r-- | modules/buildsystem/manifests/init.pp | 8 | ||||
-rwxr-xr-x | modules/buildsystem/templates/submit_package | 25 |
2 files changed, 33 insertions, 0 deletions
diff --git a/modules/buildsystem/manifests/init.pp b/modules/buildsystem/manifests/init.pp index 782e3dd2..1ff60d16 100644 --- a/modules/buildsystem/manifests/init.pp +++ b/modules/buildsystem/manifests/init.pp @@ -6,6 +6,8 @@ class buildsystem { $sched_login = "schedbot" $sched_home_dir = "/home/$sched_login" $repository_root = "/distrib/bootstrap" + $packagers_group = 'mga-packagers' + $createsrpm_path = '/usr/share/repsys/create-srpm' include ssh::auth ssh::auth::key { $build_login: } # declare a key for build bot: RSA, 2048 bits @@ -153,6 +155,12 @@ class buildsystem { require => File["/etc/youri"], content => template("buildsystem/youri_acl.conf") } + + file { '/usr/local/bin/submit_package': + ensure => present, + mode => 755, + content => template('buildsystem/submit_package') + } } define sshuser($homedir, $comment) { diff --git a/modules/buildsystem/templates/submit_package b/modules/buildsystem/templates/submit_package new file mode 100755 index 00000000..2314286e --- /dev/null +++ b/modules/buildsystem/templates/submit_package @@ -0,0 +1,25 @@ +#!/bin/sh + +packagersgroup="<%= packagers_group %>" +createsrpm="<%= createsrpm_path %>" + +function isingroup() +{ + grp="$1" + for group in `groups` + do if [ "$grp" = "$group" ] + then + return 0 + fi + done + return 1 +} + +if ! isingroup "$packagersgroup" +then + echo "You are not in $packagersgroup group." + exit 1 +fi + +exec $createsrpm "$*" + |