Skip to content

Commit

Permalink
Edit the installation script
Browse files Browse the repository at this point in the history
Get tests to pass by not specifying a Teleport version if using apt-get
with Teleport Cloud. This is because the version specified by the
`TELEPORT_VERSION` variable may not be available in the `stable/cloud`
channel.

Also remove redundant `/etc/os-release` sourcing.
  • Loading branch information
ptgott committed Jan 7, 2025
1 parent b6f4b3b commit 7bafb74
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions assets/install-scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,15 @@ install_via_apt_get() {
echo "Installing Teleport v$TELEPORT_VERSION via apt-get"
add_apt_key
set -x
$SUDO apt-get install -y "teleport$TELEPORT_SUFFIX=$TELEPORT_VERSION"

set +x
if [ "$TELEPORT_EDITION" = "cloud" ]; then
set -x
$SUDO apt-get install -y "teleport$TELEPORT_SUFFIX"
$SUDO apt-get install -y teleport-ent-updater
set +x
else
$SUDO apt-get install -y "teleport$TELEPORT_SUFFIX=$TELEPORT_VERSION"
fi
}

Expand Down Expand Up @@ -146,9 +149,6 @@ add_apt_key() {
# $1 is the value of the $ID path segment in the YUM repo URL. In
# /etc/os-release, this is either the value of $ID or $ID_LIKE.
install_via_yum() {
# shellcheck source=/dev/null
source /etc/os-release

# Get the major version from the version ID.
VERSION_ID=$(echo "$VERSION_ID" | grep -Eo "^[0-9]+")
TELEPORT_MAJOR_VERSION="v$(echo "$TELEPORT_VERSION" | grep -Eo "^[0-9]+")"
Expand Down Expand Up @@ -182,9 +182,6 @@ install_via_yum() {
}

install_via_zypper() {
# shellcheck source=/dev/null
source /etc/os-release

# Get the major version from the version ID.
VERSION_ID=$(echo "$VERSION_ID" | grep -Eo "^[0-9]+")
TELEPORT_MAJOR_VERSION="v$(echo "$TELEPORT_VERSION" | grep -Eo "^[0-9]+")"
Expand Down

0 comments on commit 7bafb74

Please sign in to comment.