]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-{ansible,installer}-rpm: fix mock group addition 598/head
authorKen Dreyer <kdreyer@redhat.com>
Thu, 15 Dec 2016 18:12:15 +0000 (11:12 -0700)
committerKen Dreyer <kdreyer@redhat.com>
Thu, 15 Dec 2016 18:15:58 +0000 (11:15 -0700)
When an ephemeral slave is first created, we have to add the
jenkins-build UID to the "mock" group so that it can run mock.

The problem is that "usermod -a -G" will not affect the current login
shell. When the ceph-*-rpm jobs run "usermod" for the first time,
the jenkins-build UID obtains those group rights for any future jobs,
but not the current job.

The result is that every time an ephemeral slave boots, it will fail its
first ceph-*-rpm build job (and future ones succeed).

Call "newgrp" to refresh the groups for this login shell, so that all
mock operations succeed, including the first one on each slave.

ceph-ansible-rpm/build/build
ceph-installer-rpm/build/build

index 4541d4d4058912d41506578e521311a235804072..ae0958ef4e2290f479250feab252fcd4c45a0d7b 100644 (file)
@@ -14,6 +14,7 @@ sudo yum -y install fedpkg
 
 # Add the Jenkins slave UID to the mock group.
 sudo usermod -a -G mock $(whoami)
+newgrp mock
 
 # Attempt the build. If it fails, print the mock logs to STDOUT.
 make rpm || ( tail -n +1 {root,build}.log && exit 1 )
index 4541d4d4058912d41506578e521311a235804072..ae0958ef4e2290f479250feab252fcd4c45a0d7b 100644 (file)
@@ -14,6 +14,7 @@ sudo yum -y install fedpkg
 
 # Add the Jenkins slave UID to the mock group.
 sudo usermod -a -G mock $(whoami)
+newgrp mock
 
 # Attempt the build. If it fails, print the mock logs to STDOUT.
 make rpm || ( tail -n +1 {root,build}.log && exit 1 )