This commit is contained in:
Alexandre
2022-01-20 21:19:51 +01:00
parent 3072b45533
commit 73a4d2b5ff

View File

@@ -134,23 +134,23 @@ done
# Install apps
[ "$VERBOSE" = true ] && echo "installing packages $PACKAGES"
[ "$PACKMANAGER" = "apt" ] && apt-get update >/dev/null || true
if [ "$PACKMANAGER" = "apt" ]; then apt-get update >/dev/null; fi
# Install apps one by one to allow failures
ERROR=0
for packagestoinstall in $PACKAGES; do
[ "$VERBOSE" = true ] && echo "... $packagestoinstall"
if [ "$PACKMANAGER" = "apk" ]; then
apk add --no-cache $packagestoinstall &>/dev/null || (echo "Error : $packagestoinstall not found" && ERROR=1)
elif [ "$PACKMANAGER" = "apt" ]; then
apt-get install -yqq --no-install-recommends $packagestoinstall &>/dev/null || (echo "Error : $packagestoinstall not found" && ERROR=1)
apk add --no-cache "$packagestoinstall" &>/dev/null || (echo "Error : $packagestoinstall not found" && touch /ERROR)
elif [ "$PACKMANAGER" = "apt" ]; then
apt-get install -yqq --no-install-recommends "$packagestoinstall" &>/dev/null || (echo "Error : $packagestoinstall not found" && touch /ERROR)
fi
[ "$VERBOSE" = true ] && echo "... $packagestoinstall done"
done
# Clean after install
[ "$VERBOSE" = true ] && echo "Cleaning apt cache"
[ "$PACKMANAGER" = "apt" ] && apt-get clean >/dev/null || true
if [ "$PACKMANAGER" = "apt" ]; then apt-get clean >/dev/null; fi
# Replace nginx if installed
if ls /etc/nginx2 1>/dev/null 2>&1; then
@@ -201,18 +201,18 @@ for files in "/scripts" "/etc/services.d" "/etc/cont-init.d"; do
if grep -q -rnw "$files/" -e "$COMMAND" && ! command -v $COMMAND &>/dev/null; then
[ "$VERBOSE" = true ] && echo "$COMMAND required"
[ "$PACKMANAGER" = "apk" ] && apk add --no-cache go npm &&
apk upgrade --no-cache &&
apk add --no-cache --virtual .build-deps build-base git go &&
go get -u github.com/quantumew/mustache-cli &&
cp "$GOPATH"/bin/* /usr/bin/ &&
rm -rf "$GOPATH" /var/cache/apk/* /tmp/src &&
apk del .build-deps xz build-base
apk upgrade --no-cache &&
apk add --no-cache --virtual .build-deps build-base git go &&
go get -u github.com/quantumew/mustache-cli &&
cp "$GOPATH"/bin/* /usr/bin/ &&
rm -rf "$GOPATH" /var/cache/apk/* /tmp/src &&
apk del .build-deps xz build-base
[ "$PACKMANAGER" = "apt" ] && apt-get update &&
apt-get install -yqq go npm node-mustache
apt-get install -yqq go npm node-mustache
fi
done
if [ $ERROR = 1 ]; then
exit 1
if [ -f /ERROR ]; then
exit 1
fi