Update install.sh (#1449)

* Update install.sh

* Update install.sh

* Update install.sh

* Update install.sh

* Update install.sh

* Update install.sh

* Update install.sh

* Update install.sh

* Update install.sh
This commit is contained in:
Nikhil Nandagopal 2020-10-29 12:04:43 +05:30 committed by GitHub
parent a7b6a754f5
commit 3c0762934f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,7 +41,7 @@ check_ports_occupied() {
echo "Appsmith requires ports 80 & 443 to be open. Please shut down any other service(s) that may be running on these ports." echo "Appsmith requires ports 80 & 443 to be open. Please shut down any other service(s) that may be running on these ports."
echo "++++++++++++++++++++++++++++++++++++++++" echo "++++++++++++++++++++++++++++++++++++++++"
echo "" echo ""
bye exit 1
fi fi
} }
@ -106,7 +106,7 @@ install_docker_compose() {
echo "docker-compose not found! Please install docker-compose first and then continue with this installation." echo "docker-compose not found! Please install docker-compose first and then continue with this installation."
echo "Refer https://docs.docker.com/compose/install/ for installing docker-compose." echo "Refer https://docs.docker.com/compose/install/ for installing docker-compose."
echo "+++++++++++++++++++++++++++++++++++++++++++++++++" echo "+++++++++++++++++++++++++++++++++++++++++++++++++"
bye exit 1
fi fi
} }
@ -352,23 +352,25 @@ echo_contact_support() {
} }
bye() { # Prints a friendly good bye message and exits the script. bye() { # Prints a friendly good bye message and exits the script.
set +o errexit if [ "$?" -ne 0 ]; then
echo "Please review the above errors, and share your email if you wish to receive support with the installation" set +o errexit
read -rp 'Email: ' email echo "Please share your email if you wish to receive support with the installation"
read -rp 'Email: ' email
curl -s --location --request POST 'https://hook.integromat.com/dkwb6i52am93pi30ojeboktvj32iw0fa' \ curl -s --location --request POST 'https://hook.integromat.com/dkwb6i52am93pi30ojeboktvj32iw0fa' \
--header 'Content-Type: text/plain' \ --header 'Content-Type: text/plain' \
--data-raw '{ --data-raw '{
"userId": "'"$APPSMITH_INSTALLATION_ID"'", "userId": "'"$APPSMITH_INSTALLATION_ID"'",
"event": "Installation Support", "event": "Installation Support",
"data": { "data": {
"os": "'"$os"'", "os": "'"$os"'",
"email": "'"$email"'" "email": "'"$email"'"
} }
}' > /dev/null }' > /dev/null
echo "" echo ""
echo -e "\nThere was an error with your installation, Exiting for now. Bye! 👋 \n" echo -e "\nWe will reach out to you at the email provided shortly, Exiting for now. Bye! 👋 \n"
exit 1 exit 0
fi
} }
echo -e "👋 Thank you for trying out Appsmith! " echo -e "👋 Thank you for trying out Appsmith! "
@ -410,7 +412,7 @@ if [[ $desired_os -eq 0 ]];then
"error": "OS Not Supported" "error": "OS Not Supported"
} }
}' > /dev/null }' > /dev/null
bye exit 1
else else
echo "🙌 You're on an OS that is supported by this installation script." echo "🙌 You're on an OS that is supported by this installation script."
echo "" echo ""
@ -420,7 +422,6 @@ if [[ $EUID -eq 0 ]]; then
echo "+++++++++++ ERROR ++++++++++++++++++++++" echo "+++++++++++ ERROR ++++++++++++++++++++++"
echo "Please do not run this script as root/sudo." echo "Please do not run this script as root/sudo."
echo "++++++++++++++++++++++++++++++++++++++++" echo "++++++++++++++++++++++++++++++++++++++++"
echo_contact_support
curl -s --location --request POST 'https://hook.integromat.com/dkwb6i52am93pi30ojeboktvj32iw0fa' \ curl -s --location --request POST 'https://hook.integromat.com/dkwb6i52am93pi30ojeboktvj32iw0fa' \
--header 'Content-Type: text/plain' \ --header 'Content-Type: text/plain' \
--data-raw '{ --data-raw '{
@ -431,7 +432,7 @@ if [[ $EUID -eq 0 ]]; then
"error": "Running as Root" "error": "Running as Root"
} }
}' > /dev/null }' > /dev/null
bye exit 1
fi fi
check_ports_occupied check_ports_occupied
@ -447,7 +448,17 @@ if [[ -e "$install_dir" ]]; then
echo "The path '$install_dir' is already present. Please run the script again with a different path to install new." echo "The path '$install_dir' is already present. Please run the script again with a different path to install new."
echo "If you're trying to update your existing installation, that happens automatically through WatchTower." echo "If you're trying to update your existing installation, that happens automatically through WatchTower."
echo_contact_support " if you're facing problems with the auto-updates." echo_contact_support " if you're facing problems with the auto-updates."
exit curl -s --location --request POST 'https://hook.integromat.com/dkwb6i52am93pi30ojeboktvj32iw0fa' \
--header 'Content-Type: text/plain' \
--data-raw '{
"userId": "'"$APPSMITH_INSTALLATION_ID"'",
"event": "Installation Error",
"data": {
"os": "'"$os"'",
"error": "Directory Exists"
}
}' > /dev/null
exit 1
fi fi
# Check is Docker daemon is installed and available. If not, the install & start Docker for Linux machines. We cannot automatically install Docker Desktop on Mac OS # Check is Docker daemon is installed and available. If not, the install & start Docker for Linux machines. We cannot automatically install Docker Desktop on Mac OS
@ -460,6 +471,16 @@ if ! is_command_present docker; then
echo "Docker Desktop must be installed manually on Mac OS to proceed. Docker can only be installed automatically on Ubuntu / openSUSE / SLES / Redhat / Cent OS" echo "Docker Desktop must be installed manually on Mac OS to proceed. Docker can only be installed automatically on Ubuntu / openSUSE / SLES / Redhat / Cent OS"
echo "https://docs.docker.com/docker-for-mac/install/" echo "https://docs.docker.com/docker-for-mac/install/"
echo "++++++++++++++++++++++++++++++++++++++++++++++++" echo "++++++++++++++++++++++++++++++++++++++++++++++++"
curl -s --location --request POST 'https://hook.integromat.com/dkwb6i52am93pi30ojeboktvj32iw0fa' \
--header 'Content-Type: text/plain' \
--data-raw '{
"userId": "'"$APPSMITH_INSTALLATION_ID"'",
"event": "Installation Error",
"data": {
"os": "'"$os"'",
"error": "Docker not installed"
}
}' > /dev/null
exit 1 exit 1
fi fi
fi fi
@ -637,19 +658,17 @@ if [[ $status_code -ne 401 ]]; then
echo -e "cd \"$install_dir\" && sudo docker-compose ps -a" echo -e "cd \"$install_dir\" && sudo docker-compose ps -a"
echo "For troubleshooting help, please reach out to us via our Discord server: https://discord.com/invite/rBTTVJp" echo "For troubleshooting help, please reach out to us via our Discord server: https://discord.com/invite/rBTTVJp"
echo "++++++++++++++++++++++++++++++++++++++++" echo "++++++++++++++++++++++++++++++++++++++++"
echo ""
echo "Please share your email to receive help with the installation"
read -rp 'Email: ' email
curl -s --location --request POST 'https://hook.integromat.com/dkwb6i52am93pi30ojeboktvj32iw0fa' \ curl -s --location --request POST 'https://hook.integromat.com/dkwb6i52am93pi30ojeboktvj32iw0fa' \
--header 'Content-Type: text/plain' \ --header 'Content-Type: text/plain' \
--data-raw '{ --data-raw '{
"userId": "'"$APPSMITH_INSTALLATION_ID"'", "userId": "'"$APPSMITH_INSTALLATION_ID"'",
"event": "Installation Support", "event": "Installation Error",
"data": { "data": {
"os": "'"$os"'", "os": "'"$os"'",
"email": "'"$email"'" "error": "Containers not started"
} }
}' > /dev/null }' > /dev/null
exit 1
else else
curl -s --location --request POST 'https://hook.integromat.com/dkwb6i52am93pi30ojeboktvj32iw0fa' \ curl -s --location --request POST 'https://hook.integromat.com/dkwb6i52am93pi30ojeboktvj32iw0fa' \
--header 'Content-Type: text/plain' \ --header 'Content-Type: text/plain' \
@ -661,7 +680,7 @@ else
} }
}' > /dev/null }' > /dev/null
echo "+++++++++++ SUCCESS ++++++++++++++++++++++++++++++" echo "++++++++++++++++++ SUCCESS ++++++++++++++++++++++"
echo "Your installation is complete!" echo "Your installation is complete!"
echo "" echo ""
if [[ -z $custom_domain ]]; then if [[ -z $custom_domain ]]; then
@ -687,5 +706,4 @@ else
} }
}' > /dev/null }' > /dev/null
fi fi
echo -e "\nPeace out ✌️\n" echo -e "\nPeace out ✌️\n"