Skip to content

Commit

Permalink
feat(dockerfile.*): remove Tiamat if block since no longer needed
Browse files Browse the repository at this point in the history
  • Loading branch information
myii committed Dec 9, 2022
1 parent d9a5565 commit c398085
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 64 deletions.
34 changes: 4 additions & 30 deletions Dockerfile.apt
Original file line number Diff line number Diff line change
Expand Up @@ -28,36 +28,10 @@ SHELL ["/bin/bash", "-x", "-o", "pipefail", "-c"]
# hadolint ignore=SC1075,DL3008,DL4001
RUN apt-get update \
&& apt-get install --yes --no-install-recommends $PKGS \
&& if [ "${SALT_VERSION}" != "tiamat" ]; then \
# Install Salt using the bootstrap script (removing the 10 seconds delay to cancel the bootstrap)
curl -L https://raw.githubusercontent.com/saltstack/salt-bootstrap/develop/bootstrap-salt.sh | \
sed -e '/^\s\+echowarn "You have 10 seconds to cancel and stop the bootstrap process..."/,+2d' | \
sh -s -- ${SALT_REPO_URL} -XUdfPD -x python$PYTHON_VERSION $SALT_INSTALL_METHOD $SALT_VERSION; \
else \
# Use `buster` packages for `bookworm` until specific Tiamat package available
if [ "${DISTRO_VERSION}" = "bookworm" ]; then \
DISTRO_VERSION="10"; \
# Use temporary workaround of installing `contextvars`
pip3 install --no-cache-dir contextvars==2.4; \
# Use `buster` packages for `bullseye` until specific Tiamat package available
# Using this as a separate conditional since this will eventually be adjusted
# separately from `bookworm` above
elif [ "${DISTRO_VERSION}" = "11" ]; then \
DISTRO_VERSION="10"; \
# Use `20.04` packages for `22.04` until specific Tiamat package available
elif [ "${DISTRO_VERSION}" = "22.04" ]; then \
DISTRO_VERSION="20.04"; \
# Use temporary workaround of installing `contextvars`
pip3 install --no-cache-dir contextvars==2.4; \
fi; \
echo "${DISTRO_VERSION}"; \
# Prepare the repo
curl -fsSL -o /usr/share/keyrings/salt-archive-keyring.gpg https://repo.saltproject.io/salt-dev/py3/${DISTRO_NAME}/${DISTRO_VERSION}/amd64/salt-archive-keyring.gpg; \
echo "deb [signed-by=/usr/share/keyrings/salt-archive-keyring.gpg] https://repo.saltproject.io/salt-dev/py3/${DISTRO_NAME}/${DISTRO_VERSION}/amd64 stable main" | tee /etc/apt/sources.list.d/salt-dev.list; \
# Install the package
apt-get update; \
apt-get install --yes --no-install-recommends salt-minion; \
fi \
# Install Salt using the bootstrap script (removing the 10 seconds delay to cancel the bootstrap)
&& curl -L https://raw.githubusercontent.com/saltstack/salt-bootstrap/develop/bootstrap-salt.sh | \
sed -e '/^\s\+echowarn "You have 10 seconds to cancel and stop the bootstrap process..."/,+2d' | \
sh -s -- ${SALT_REPO_URL} -XUdfPD -x python$PYTHON_VERSION $SALT_INSTALL_METHOD $SALT_VERSION \
# Disable salt's service as we don't need it running
&& systemctl disable salt-minion.service > /dev/null 2>&1 \
# Similar to Fedora, Arch Linux, Tumbleweed & Gentoo, enable the `ssh-rsa` keypair
Expand Down
38 changes: 4 additions & 34 deletions Dockerfile.yum
Original file line number Diff line number Diff line change
Expand Up @@ -26,40 +26,10 @@ RUN if [[ "${DISTRO_NAME}" = "centos" ]]; then \
yum -y install epel-release; \
fi \
&& yum -y install ${PKGS} \
&& if [ "${SALT_VERSION}" != "tiamat" ]; then \
# Install Salt using the bootstrap script (removing the 10 seconds delay to cancel the bootstrap)
curl -L https://raw.githubusercontent.com/saltstack/salt-bootstrap/develop/bootstrap-salt.sh | \
sed -e '/^\s\+echowarn "You have 10 seconds to cancel and stop the bootstrap process..."/,+2d' | \
sh -s -- ${SALT_REPO_URL} -XUdfPD -x python$PYTHON_VERSION $SALT_INSTALL_METHOD $SALT_VERSION; \
else \
# Prepare the `TIAMAT_DISTRO_NAME`
if [ "${DISTRO_NAME}" = "amazonlinux" ]; then \
TIAMAT_DISTRO_NAME="amazon"; \
else \
TIAMAT_DISTRO_NAME="redhat"; \
fi; \
echo "${TIAMAT_DISTRO_NAME}"; \
# Prepare the `TIAMAT_DISTRO_VERSION`
if [ "${DISTRO_VERSION}" = "stream8" ]; then \
TIAMAT_DISTRO_VERSION="8"; \
else \
TIAMAT_DISTRO_VERSION="${DISTRO_VERSION}"; \
fi; \
echo "${TIAMAT_DISTRO_VERSION}"; \
# Prepare the `EPEL_PACKAGE_NAME`
if [ "${DISTRO_NAME}" = "oraclelinux" ]; then \
EPEL_PACKAGE_NAME="oracle-epel-release-el${DISTRO_VERSION}"; \
else \
EPEL_PACKAGE_NAME="epel-release"; \
fi; \
echo "${EPEL_PACKAGE_NAME}"; \
# Prepare the repo
rpm --import https://repo.saltproject.io/salt-dev/py3/${TIAMAT_DISTRO_NAME}/${TIAMAT_DISTRO_VERSION}/x86_64/SALTSTACK-GPG-KEY.pub; \
curl -fsSL https://repo.saltproject.io/salt-dev/py3/${TIAMAT_DISTRO_NAME}/${TIAMAT_DISTRO_VERSION}/x86_64/dev.repo | tee /etc/yum.repos.d/salt-dev.repo; \
# Install the package
yum clean expire-cache; \
yum -y install "${EPEL_PACKAGE_NAME}" salt-minion; \
fi \
# Install Salt using the bootstrap script (removing the 10 seconds delay to cancel the bootstrap)
&& curl -L https://raw.githubusercontent.com/saltstack/salt-bootstrap/develop/bootstrap-salt.sh | \
sed -e '/^\s\+echowarn "You have 10 seconds to cancel and stop the bootstrap process..."/,+2d' | \
sh -s -- ${SALT_REPO_URL} -XUdfPD -x python$PYTHON_VERSION $SALT_INSTALL_METHOD $SALT_VERSION \
&& if command -v systemctl; then \
systemctl disable salt-minion.service > /dev/null 2>&1; \
elif [ -f "/etc/init.d/salt-minion" ]; then \
Expand Down

0 comments on commit c398085

Please sign in to comment.