Skip to content

Commit

Permalink
test: remove sudo in mockbuild.sh
Browse files Browse the repository at this point in the history
quay.io/feodra/fedora:40 image does not include sudo package

Signed-off-by: Xiaofeng Wang <[email protected]>
  • Loading branch information
henrywang committed Mar 17, 2024
1 parent ac17000 commit 5d5458f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/integration/mockbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function redprint {
}

greenprint "📥 Install required packages"
sudo dnf install -y cargo zstd git openssl-devel ostree-devel rpm-build mock podman skopeo jq
dnf install -y cargo zstd git openssl-devel ostree-devel rpm-build mock podman skopeo jq
cargo install cargo-vendor-filterer

greenprint "⛏ Build archive"
Expand All @@ -25,13 +25,13 @@ case "$TEST_OS" in
TEMPLATE="rhel-9.tpl"
greenprint "📝 update mock rhel-9 template"
# disable subscription for nightlies
sudo sed -i "s/config_opts\['redhat_subscription_required'\] = True/config_opts['redhat_subscription_required'] = False/" /etc/mock/templates/"$TEMPLATE"
sed -i "s/config_opts\['redhat_subscription_required'\] = True/config_opts['redhat_subscription_required'] = False/" /etc/mock/templates/"$TEMPLATE"
# delete default cdn compose and add nightly compose
IMAGE_NAME="rhel9-rhel_bootc"
TIER1_IMAGE_URL="${RHEL_REGISTRY_URL}/${IMAGE_NAME}:rhel-9.4"
CURRENT_COMPOSE_RHEL94=$(skopeo inspect --tls-verify=false "docker://${TIER1_IMAGE_URL}" | jq -r '.Labels."redhat.compose-id"')
sudo sed -i '/user_agent/q' /etc/mock/templates/"$TEMPLATE"
sudo tee -a /etc/mock/templates/"$TEMPLATE" > /dev/null << EOF
sed -i '/user_agent/q' /etc/mock/templates/"$TEMPLATE"
tee -a /etc/mock/templates/"$TEMPLATE" > /dev/null << EOF
[BaseOS]
name=Red Hat Enterprise Linux - BaseOS
baseurl=http://${DOWNLOAD_NODE}/rhel-9/nightly/RHEL-9/${CURRENT_COMPOSE_RHEL94}/compose/BaseOS/\$basearch/os/
Expand Down Expand Up @@ -65,7 +65,7 @@ esac
greenprint "🧬 Using mock config: ${MOCK_CONFIG}"

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

greenprint "🎁 Building SRPM"
mock -r "$MOCK_CONFIG" --buildsrpm \
Expand Down

0 comments on commit 5d5458f

Please sign in to comment.