Skip to content

Commit

Permalink
add check for GEMSTONE_BATTERY_CI ... internal builds should not use …
Browse files Browse the repository at this point in the history
…sudo at all, to minimize console security messages while running tests
  • Loading branch information
dalehenrich committed Dec 15, 2023
1 parent 64961ab commit 8f96d20
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
18 changes: 10 additions & 8 deletions gemstone/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,17 @@ gemstone::prepare_superDoit() {
# Prepare environment for running GemStone
################################################################################
gemstone::prepare_gemstone() {
if [ ! -e /opt/gemstone ]
if ! is_internal_gemstone_build; then
if [ ! -e /opt/gemstone ]
then
echo "[Info] Creating /opt/gemstone directory"
sudo mkdir -p /opt/gemstone /opt/gemstone/log /opt/gemstone/locks
sudo chown $USER:${GROUPS[0]} /opt/gemstone /opt/gemstone/log /opt/gemstone/locks
sudo chmod 770 /opt/gemstone /opt/gemstone/log /opt/gemstone/locks
else
echo "[Warning] /opt/gemstone directory already exists"
echo "to replace it, remove or rename it and rerun this script"
echo "[Info] Creating /opt/gemstone directory"
sudo mkdir -p /opt/gemstone /opt/gemstone/log /opt/gemstone/locks
sudo chown $USER:${GROUPS[0]} /opt/gemstone /opt/gemstone/log /opt/gemstone/locks
sudo chmod 770 /opt/gemstone /opt/gemstone/log /opt/gemstone/locks
else
echo "[Warning] /opt/gemstone directory already exists"
echo "to replace it, remove or rename it and rerun this script"
fi
fi
}
################################################################################
Expand Down
4 changes: 4 additions & 0 deletions helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,10 @@ hardware_platform() {
echo "$(uname -m)"
}

is_internal_gemstone_build() {
[[ "${GEMSTONE_BATTERY_CI:-}" = "true" ]]
}

is_sudo_enabled() {
$(sudo -n true > /dev/null 2>&1)
}
Expand Down
2 changes: 1 addition & 1 deletion run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ prepare_folders() {
################################################################################
prepare_environment() {
add_env_vars
if is_linux_build && is_sudo_enabled; then
if ! is_internal_gemstone_build && is_linux_build && is_sudo_enabled; then
raise_rtprio_limit
fi
}
Expand Down

0 comments on commit 8f96d20

Please sign in to comment.