Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions ci/setup-ci-host.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env bash
set -e
shopt -s expand_aliases
thisdir="$(dirname "$0")"

_packages="" # a space separated list of packages to install
Expand All @@ -9,7 +8,7 @@ function add-pkg() {
}

function install-packages() {
# note that "packages" is an alias defined later during OS/distribution discovery
# note that "packages" is a function defined later during OS/distribution discovery
# shellcheck disable=SC2086
packages $_packages
}
Expand Down Expand Up @@ -56,21 +55,21 @@ if [ -f /etc/os-release ]; then
source /etc/os-release
if grep -q rhel /etc/os-release; then
yum update --assumeyes
alias packages='yum install --assumeyes'
function packages() { yum install --assumeyes "$@"; }
redhat="$VERSION_ID"
elif grep -q debian /etc/os-release; then
alias packages='DEBIAN_FRONTEND=noninteractive apt install --quiet --yes'
function packages() { DEBIAN_FRONTEND=noninteractive apt install --quiet --yes "$@"; }
debian="$VERSION_ID"
elif grep -q suse /etc/os-release; then
alias packages='zypper install -y'
function packages() { zypper install -y "$@"; }
# shellcheck disable=SC2034
suse="$VERSION_ID"
else
echo "Unknown platform ID $ID. Need this information in order to update/upgrade distribution packages."
exit 1
fi
elif [ -f /etc/redhat-release ]; then
alias packages='yum install --assumeyes'
function packages() { yum install --assumeyes "$@"; }
# shellcheck disable=SC1091
source /etc/redhat-release
redhat="$VERSION_ID"
Expand Down Expand Up @@ -200,11 +199,8 @@ if [ "$redhat" != 0 ]; then

fi

# packages is a dynamic alias set near the top of this script
# ^^^ we want space separated package names as separate args, not one arg with the space separated list
whoami
set -x
# shellcheck disable=SC2086
install-packages
set +x

Expand Down
Loading