diff --git a/install.sh b/install.sh index b37018f847..d73a7cf806 100755 --- a/install.sh +++ b/install.sh @@ -4,37 +4,6 @@ set -e bash preinstall.sh -if [[ ! $(which docker) && ! $(docker --version) ]]; then - echo "Setting up Docker" - sudo curl -sSL https://get.docker.com/ | sh -fi - - -# If docker still fails to install, then quit. -if [[ ! $(which docker) && ! $(docker --version) ]]; then - echo -e "Failed to install docker. Please install Docker manually here: https://docs.docker.com/install." - echo -e "Exiting the OneUptime installer." - exit -fi - - -# enable docker without sudo -sudo usermod -aG docker "${USER}" || true - -if [[ ! $(which docker-compose) && ! $(docker-compose --version) ]]; then -mkdir -p /usr/local/lib/docker/cli-plugins -curl -SL https://github.com/docker/compose/releases/download/v2.12.2/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/lib/docker/cli-plugins -sudo chmod +x /usr/local/lib/docker/cli-plugins/docker-compose -docker compose version -fi - -# If docker still fails to install, then quit. -if [[ ! $(which docker-compose) && ! $(docker-compose --version) ]]; then - echo -e "Failed to install docker-domcpose. Please install Docker Compose manually here: https://docs.docker.com/compose/install/linux/#install-the-plugin-manually." - echo -e "Exiting the OneUptime installer." - exit -fi - npm run start echo "We will need to wait ~5-10 minutes for things to settle down, migrations to finish, and TLS certs to be issued" diff --git a/preinstall.sh b/preinstall.sh index cfd8f1b777..818532d1c4 100644 --- a/preinstall.sh +++ b/preinstall.sh @@ -94,8 +94,39 @@ if [[ ! $(which node) && ! $(node --version) ]]; then fi fi +if [[ ! $(which docker) && ! $(docker --version) ]]; then + echo "Setting up Docker" + sudo curl -sSL https://get.docker.com/ | sh +fi + + +# If docker still fails to install, then quit. +if [[ ! $(which docker) && ! $(docker --version) ]]; then + echo -e "Failed to install docker. Please install Docker manually here: https://docs.docker.com/install." + echo -e "Exiting the OneUptime installer." + exit +fi + + +# enable docker without sudo +sudo usermod -aG docker "${USER}" || true + +if [[ ! $(which docker-compose) && ! $(docker-compose --version) ]]; then +mkdir -p /usr/local/lib/docker/cli-plugins +curl -SL https://github.com/docker/compose/releases/download/v2.12.2/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/lib/docker/cli-plugins +sudo chmod +x /usr/local/lib/docker/cli-plugins/docker-compose +docker compose version +fi + +# If docker still fails to install, then quit. +if [[ ! $(which docker-compose) && ! $(docker-compose --version) ]]; then + echo -e "Failed to install docker-domcpose. Please install Docker Compose manually here: https://docs.docker.com/compose/install/linux/#install-the-plugin-manually." + echo -e "Exiting the OneUptime installer." + exit +fi + if [[ ! $(which gomplate) ]]; then - sudo npm install -g gomplate + alias gomplate='docker run hairyhenderson/gomplate:stable' fi if [[ ! $(which ts-node) ]]; then