Skip to content

Commit

Permalink
schutzbot/mockbuild: stop running mock as root
Browse files Browse the repository at this point in the history
Running mock as root is broken, this commit can be reverted once this is
fixed.

rhbz#2135203
  • Loading branch information
croissanne committed Oct 17, 2022
1 parent a23b1c4 commit 545ce34
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions schutzbot/mockbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,13 @@ greenprint "📤 RPMS will be uploaded to: ${REPO_URL}"
# override template repositories
template_override

greenprint "✏ Adding user to mock group"
sudo usermod -a -G mock "$(whoami)"

greenprint "🔧 Building source RPM"
git archive --prefix "osbuild-composer-${COMMIT}/" --output "osbuild-composer-${COMMIT}.tar.gz" HEAD
./tools/rpm_spec_add_provides_bundle.sh
sudo mock -r "$MOCK_CONFIG" --buildsrpm \
mock -r "$MOCK_CONFIG" --buildsrpm \
--define "commit ${COMMIT}" \
--spec ./osbuild-composer.spec \
--sources "./osbuild-composer-${COMMIT}.tar.gz" \
Expand All @@ -115,7 +118,7 @@ if [ "${NIGHTLY:=false}" == "true" ]; then
fi

greenprint "🎁 Building RPMs"
sudo mock -r "$MOCK_CONFIG" \
mock -r "$MOCK_CONFIG" \
--define "commit ${COMMIT}" \
--with=tests \
${RELAX_REQUIRES:+"$RELAX_REQUIRES"} \
Expand Down

0 comments on commit 545ce34

Please sign in to comment.