Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[teleport-update] Move teleport binaries to new path {deb,rpm} #49110

Merged
merged 19 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
65b4088
Move teleport binaries to new path
vapopov Nov 16, 2024
cc23056
Merge remote-tracking branch 'origin/master' into vapopov/build-telep…
vapopov Nov 19, 2024
3ac63a0
Use link/unlink command to manage links
vapopov Nov 19, 2024
80de703
Merge remote-tracking branch 'origin/master' into vapopov/build-telep…
vapopov Nov 19, 2024
4855745
Move teleport binaries under standard path for distroless
vapopov Nov 20, 2024
89b32da
Fix wrong move path
vapopov Nov 20, 2024
a16f9c6
Create missing directory
vapopov Nov 20, 2024
a1da9f1
Rename link/unlink commands
vapopov Nov 20, 2024
981c042
Exclude teleport-update from docker image
vapopov Nov 20, 2024
28c5e93
Merge remote-tracking branch 'origin/master' into vapopov/build-telep…
vapopov Nov 20, 2024
df249f2
Merge remote-tracking branch 'origin/master' into vapopov/build-telep…
vapopov Nov 21, 2024
7ebb1e2
Merge remote-tracking branch 'origin/master' into vapopov/build-telep…
vapopov Nov 22, 2024
dd5594d
Add teleport-update to AMI image build
vapopov Nov 22, 2024
62ee8c3
Fix RPM build, fpm automatically manage scripts
vapopov Nov 22, 2024
d109f68
Fix AMI build, add missing teleport.service
vapopov Nov 22, 2024
98b8149
Merge remote-tracking branch 'origin/master' into vapopov/build-telep…
vapopov Dec 5, 2024
8a0fb1f
Move binaries to /opt/teleport/system
vapopov Dec 5, 2024
7b428d0
Merge remote-tracking branch 'origin/master' into vapopov/build-telep…
vapopov Dec 13, 2024
347710f
Merge remote-tracking branch 'origin/master' into vapopov/build-telep…
vapopov Dec 16, 2024
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
19 changes: 12 additions & 7 deletions build.assets/build-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ TARBALL_DIRECTORY="$s"
GNUPG_DIR=${GNUPG_DIR:-/tmp/gnupg}

# linux package configuration
LINUX_BINARY_DIR=/usr/local/bin
LINUX_SYSTEMD_DIR=/lib/systemd/system
LINUX_BINARY_DIR=/usr/local/teleport-system/bin
LINUX_SYSTEMD_DIR=/usr/local/teleport-system/lib/systemd/system
LINUX_CONFIG_DIR=/etc
LINUX_DATA_DIR=/var/lib/teleport

Expand Down Expand Up @@ -226,8 +226,8 @@ if [[ "${PACKAGE_TYPE}" == "pkg" ]]; then
PKG_FILENAME="teleport-bin-${TELEPORT_VERSION}${ARCH_TAG}.${PACKAGE_TYPE}"
fi
else
FILE_LIST="${TAR_PATH}/tsh ${TAR_PATH}/tctl ${TAR_PATH}/teleport ${TAR_PATH}/tbot ${TAR_PATH}/fdpass-teleport ${TAR_PATH}/examples/systemd/teleport.service ${TAR_PATH}/examples/systemd/post-upgrade"
LINUX_BINARY_FILE_LIST="${TAR_PATH}/tsh ${TAR_PATH}/tctl ${TAR_PATH}/tbot ${TAR_PATH}/fdpass-teleport ${TAR_PATH}/teleport"
FILE_LIST="${TAR_PATH}/tsh ${TAR_PATH}/tctl ${TAR_PATH}/teleport ${TAR_PATH}/tbot ${TAR_PATH}/fdpass-teleport ${TAR_PATH}/teleport-update ${TAR_PATH}/examples/systemd/teleport.service ${TAR_PATH}/examples/systemd/post-install ${TAR_PATH}/examples/systemd/before-remove"
LINUX_BINARY_FILE_LIST="${TAR_PATH}/tsh ${TAR_PATH}/tctl ${TAR_PATH}/tbot ${TAR_PATH}/fdpass-teleport ${TAR_PATH}/teleport ${TAR_PATH}/teleport-update"
LINUX_SYSTEMD_FILE_LIST="${TAR_PATH}/examples/systemd/teleport.service"
EXTRA_DOCKER_OPTIONS=""
RPM_SIGN_STANZA=""
Expand Down Expand Up @@ -291,8 +291,12 @@ if [[ "${PACKAGE_TYPE}" != "pkg" ]]; then
CONFIG_FILE_STANZA="--config-files /src/buildroot${LINUX_CONFIG_DIR}/${LINUX_CONFIG_FILE} "
fi

# include post-upgrade script
mv -v ${TAR_PATH}/examples/systemd/post-upgrade ${PACKAGE_TEMPDIR}
# include post-install and before-remove script
mv -v ${TAR_PATH}/examples/systemd/post-install ${PACKAGE_TEMPDIR}
mv -v ${TAR_PATH}/examples/systemd/before-remove ${PACKAGE_TEMPDIR}

# create versions folder
mkdir -p ${PACKAGE_TEMPDIR}/buildroot${LINUX_DATA_DIR}/versions

# /var/lib/teleport
# shellcheck disable=SC2174
Expand Down Expand Up @@ -369,7 +373,8 @@ else
--provides teleport \
--prefix / \
--verbose \
--after-upgrade /src/post-upgrade \
--after-install /src/post-install \
--before-remove /src/before-remove \
${CONFIG_FILE_STANZA} \
${FILE_PERMISSIONS_STANZA} \
${RPM_SIGN_STANZA} .
Expand Down
18 changes: 18 additions & 0 deletions examples/systemd/before-remove
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

# this post upgrade script is run each time the teleport package is upgraded

set -eu

case "$1" in
remove|deconfigure)
echo "Removing symlinks from teleport system paths..."
/usr/local/teleport-system/bin/teleport-update unlink
sclevine marked this conversation as resolved.
Show resolved Hide resolved
;;
esac

# skip reload and restart when systemd is disabled. This is only relevant when
# testing in a container.
if [ -d /run/systemd/system ]; then
systemctl --system daemon-reload >/dev/null || true
fi
7 changes: 7 additions & 0 deletions examples/systemd/post-upgrade → examples/systemd/post-install
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@

set -eu

case "$1" in
configure)
vapopov marked this conversation as resolved.
Show resolved Hide resolved
/usr/local/teleport-system/bin/teleport-update link
echo "Post-install symlink creation completed."
;;
esac

# skip reload and restart when systemd is disabled. This is only relevant when
# testing in a container.
if [ -d /run/systemd/system ]; then
Expand Down
Loading