chore: Update Coolify installer and scripts to include a function for fetching programming jokes

This commit is contained in:
Andras Bacsai
2024-09-16 16:35:52 +02:00
parent 9b48a99798
commit d2d56f136b
2 changed files with 21 additions and 21 deletions

View File

@@ -21,6 +21,13 @@ INSTALLATION_LOG_WITH_DATE="/data/coolify/source/installation-${DATE}.log"
exec > >(tee -a $INSTALLATION_LOG_WITH_DATE) 2>&1 exec > >(tee -a $INSTALLATION_LOG_WITH_DATE) 2>&1
getAJoke() {
JOKES=$(curl -s --max-time 2 https://v2.jokeapi.dev/joke/Programming?format=txt&type=single&amount=1 || true)
if [ "$JOKES" != "" ]; then
echo -e " - Until then, here's a joke for you:\n"
echo -e "$JOKES\n"
fi
}
CDN="https://cdn.coollabs.io/coolify-nightly" CDN="https://cdn.coollabs.io/coolify-nightly"
OS_TYPE=$(grep -w "ID" /etc/os-release | cut -d "=" -f 2 | tr -d '"') OS_TYPE=$(grep -w "ID" /etc/os-release | cut -d "=" -f 2 | tr -d '"')
ENV_FILE="/data/coolify/source/.env" ENV_FILE="/data/coolify/source/.env"
@@ -202,6 +209,7 @@ fi
echo -e "3. Check Docker Installation. " echo -e "3. Check Docker Installation. "
if ! [ -x "$(command -v docker)" ]; then if ! [ -x "$(command -v docker)" ]; then
echo " - Docker is not installed. Installing Docker. It may take a while." echo " - Docker is not installed. Installing Docker. It may take a while."
getAJoke
case "$OS_TYPE" in case "$OS_TYPE" in
"almalinux") "almalinux")
dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo >/dev/null 2>&1 dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo >/dev/null 2>&1
@@ -477,22 +485,14 @@ chmod -R 700 /data/coolify
echo -e "9. Installing Coolify ($LATEST_VERSION)" echo -e "9. Installing Coolify ($LATEST_VERSION)"
echo -e " - It could take a while based on your server's performance, network speed, stars, etc." echo -e " - It could take a while based on your server's performance, network speed, stars, etc."
echo -e " - Please wait." echo -e " - Please wait."
JOKES=$(curl -s https://v2.jokeapi.dev/joke/Programming?format=txt&type=single&amount=1 || true) getAJoke
if [ "$JOKES" != "" ]; then
echo -e " - Until then, here's a joke for you:\n"
echo -e "$JOKES\n"
fi
bash /data/coolify/source/upgrade.sh "${LATEST_VERSION:-latest}" "${LATEST_HELPER_VERSION:-latest}" >/dev/null 2>&1 bash /data/coolify/source/upgrade.sh "${LATEST_VERSION:-latest}" "${LATEST_HELPER_VERSION:-latest}" >/dev/null 2>&1
echo " - Coolify installed successfully." echo " - Coolify installed successfully."
rm -f $ENV_FILE-$DATE rm -f $ENV_FILE-$DATE
echo " - Waiting for 20 seconds for Coolify (database migrations) to be ready." echo " - Waiting for 20 seconds for Coolify (database migrations) to be ready."
JOKES=$(curl -s https://v2.jokeapi.dev/joke/Programming?format=txt&type=single&amount=1 || true) getAJoke
if [ "$JOKES" != "" ]; then
echo -e " - Until then, here's a joke for you:\n"
echo -e "$JOKES\n"
fi
sleep 20 sleep 20
echo -e "\033[0;35m echo -e "\033[0;35m

View File

@@ -21,7 +21,14 @@ INSTALLATION_LOG_WITH_DATE="/data/coolify/source/installation-${DATE}.log"
exec > >(tee -a $INSTALLATION_LOG_WITH_DATE) 2>&1 exec > >(tee -a $INSTALLATION_LOG_WITH_DATE) 2>&1
CDN="https://cdn.coollabs.io/coolify-nightly" getAJoke() {
JOKES=$(curl -s --max-time 2 https://v2.jokeapi.dev/joke/Programming?format=txt&type=single&amount=1 || true)
if [ "$JOKES" != "" ]; then
echo -e " - Until then, here's a joke for you:\n"
echo -e "$JOKES\n"
fi
}
CDN="https://cdn.coollabs.io/coolify"
OS_TYPE=$(grep -w "ID" /etc/os-release | cut -d "=" -f 2 | tr -d '"') OS_TYPE=$(grep -w "ID" /etc/os-release | cut -d "=" -f 2 | tr -d '"')
ENV_FILE="/data/coolify/source/.env" ENV_FILE="/data/coolify/source/.env"
@@ -202,6 +209,7 @@ fi
echo -e "3. Check Docker Installation. " echo -e "3. Check Docker Installation. "
if ! [ -x "$(command -v docker)" ]; then if ! [ -x "$(command -v docker)" ]; then
echo " - Docker is not installed. Installing Docker. It may take a while." echo " - Docker is not installed. Installing Docker. It may take a while."
getAJoke
case "$OS_TYPE" in case "$OS_TYPE" in
"almalinux") "almalinux")
dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo >/dev/null 2>&1 dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo >/dev/null 2>&1
@@ -477,22 +485,14 @@ chmod -R 700 /data/coolify
echo -e "9. Installing Coolify ($LATEST_VERSION)" echo -e "9. Installing Coolify ($LATEST_VERSION)"
echo -e " - It could take a while based on your server's performance, network speed, stars, etc." echo -e " - It could take a while based on your server's performance, network speed, stars, etc."
echo -e " - Please wait." echo -e " - Please wait."
JOKES=$(curl -s https://v2.jokeapi.dev/joke/Programming?format=txt&type=single&amount=1 || true) getAJoke
if [ "$JOKES" != "" ]; then
echo -e " - Until then, here's a joke for you:\n"
echo -e "$JOKES\n"
fi
bash /data/coolify/source/upgrade.sh "${LATEST_VERSION:-latest}" "${LATEST_HELPER_VERSION:-latest}" >/dev/null 2>&1 bash /data/coolify/source/upgrade.sh "${LATEST_VERSION:-latest}" "${LATEST_HELPER_VERSION:-latest}" >/dev/null 2>&1
echo " - Coolify installed successfully." echo " - Coolify installed successfully."
rm -f $ENV_FILE-$DATE rm -f $ENV_FILE-$DATE
echo " - Waiting for 20 seconds for Coolify (database migrations) to be ready." echo " - Waiting for 20 seconds for Coolify (database migrations) to be ready."
JOKES=$(curl -s https://v2.jokeapi.dev/joke/Programming?format=txt&type=single&amount=1 || true) getAJoke
if [ "$JOKES" != "" ]; then
echo -e " - Until then, here's a joke for you:\n"
echo -e "$JOKES\n"
fi
sleep 20 sleep 20
echo -e "\033[0;35m echo -e "\033[0;35m