switch to hybrid

This commit is contained in:
aptalca
2022-07-27 11:04:46 -04:00
parent 3b7f0e4ade
commit 5c4a59c60e
16 changed files with 62 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/with-contenv bash
if [ -f /usr/bin/apt ]; then
apt-get update
fi
@@ -0,0 +1 @@
oneshot
@@ -0,0 +1 @@
/etc/s6-overlay/s6-rc.d/init-mod-apt-get/run
@@ -0,0 +1,15 @@
#!/usr/bin/with-contenv bash
echo "*** AWSCLI Installer ***"
echo "Checking if awscli is installed"
if ! aws -v COMMAND &> /dev/null; then
echo "**** awscli not installed, adding to packages to be installed ****"
echo "awscli" >> /mod-pip-packages-to-install.list
if ! pip3 -v COMMAND &> /dev/null; then
echo "*** Pip not installed, adding to packages to be installed ****"
echo "python3 python3-pip" >> /mod-repo-packages-to-install.list
fi
else
echo "awscli already installed, skipping!"
fi
@@ -0,0 +1 @@
oneshot
@@ -0,0 +1 @@
/etc/s6-overlay/s6-rc.d/init-mod-awscli-add-package/run
+36
View File
@@ -0,0 +1,36 @@
#!/usr/bin/with-contenv bash
if [ -f "/mod-repo-packages-to-install.list" ]; then
echo "**** Installing all mod packages ****"
if [ -f /usr/bin/apt ]; then
DEBIAN_FRONTEND="noninteractive"
apt-get install -y \
$(cat /mod-repo-packages-to-install.list)
elif [ -f /usr/bin/apk ]; then
apk add --no-cache \
$(cat /mod-repo-packages-to-install.list)
fi
else
echo "**** No repo packages to install, skipping ****"
fi
if [ -f "/mod-pip-packages-to-install.list" ]; then
echo "**** Installing all pip packages ****"
python3 -m pip install -U pip wheel setuptools
if [ -f /usr/bin/apt ]; then
PIP_ARGS="-f https://wheel-index.linuxserver.io/ubuntu/"
elif [ -f /usr/bin/apk ]; then
ALPINE_VER=$(cat /etc/apk/repositories | grep main | sed 's|.*alpine/v||' | sed 's|/main.*||')
if [ "${ALPINE_VER}" = "3.14" ]; then
PIP_ARGS="-f https://wheel-index.linuxserver.io/alpine/"
else
PIP_ARGS="-f https://wheel-index.linuxserver.io/alpine-${ALPINE_VER}/"
fi
fi
python3 -m pip install ${PIP_ARGS} \
$(cat /mod-pip-packages-to-install.list)
fi
rm -rf \
/mod-repo-packages-to-install.list \
/mod-pip-packages-to-install.list
@@ -0,0 +1 @@
oneshot
@@ -0,0 +1 @@
/etc/s6-overlay/s6-rc.d/init-mod-package-install/run