From 0d90b3c5fec43fe66fc1e9c3856519f91e4454cf Mon Sep 17 00:00:00 2001 From: Ken Dreyer Date: Thu, 15 Dec 2016 11:12:15 -0700 Subject: [PATCH] ceph-{ansible,installer}-rpm: fix mock group addition 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 | 1 + ceph-installer-rpm/build/build | 1 + 2 files changed, 2 insertions(+) diff --git a/ceph-ansible-rpm/build/build b/ceph-ansible-rpm/build/build index 4541d4d4..ae0958ef 100644 --- a/ceph-ansible-rpm/build/build +++ b/ceph-ansible-rpm/build/build @@ -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 ) diff --git a/ceph-installer-rpm/build/build b/ceph-installer-rpm/build/build index 4541d4d4..ae0958ef 100644 --- a/ceph-installer-rpm/build/build +++ b/ceph-installer-rpm/build/build @@ -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 ) -- 2.47.3