From bca85933f762a2599356d2ca3d7ce2e023bdb115 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Tue, 16 Mar 2021 23:09:38 +0000 Subject: [PATCH] make sure postgres is enabled and running. update npm --- docker/containers/tactical-frontend/dockerfile | 1 + install.sh | 5 +++++ restore.sh | 6 +++--- update.sh | 6 ++++++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/docker/containers/tactical-frontend/dockerfile b/docker/containers/tactical-frontend/dockerfile index 5a525cbe..7b343823 100644 --- a/docker/containers/tactical-frontend/dockerfile +++ b/docker/containers/tactical-frontend/dockerfile @@ -3,6 +3,7 @@ FROM node:12-alpine AS builder WORKDIR /home/node/app COPY ./web/package.json . +RUN npm install -g npm RUN npm install COPY ./web . diff --git a/install.sh b/install.sh index 3e368166..a6d90e68 100644 --- a/install.sh +++ b/install.sh @@ -216,6 +216,7 @@ curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - sudo apt update sudo apt install -y gcc g++ make sudo apt install -y nodejs +sudo npm install -g npm print_green 'Installing MongoDB' @@ -251,6 +252,10 @@ echo "$postgresql_repo" | sudo tee /etc/apt/sources.list.d/pgdg.list wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - sudo apt update sudo apt install -y postgresql-13 +sleep 2 +sudo systemctl enable postgresql +sudo systemctl restart postgresql +sleep 5 print_green 'Creating database for the rmm' diff --git a/restore.sh b/restore.sh index d757e63e..5d336c86 100755 --- a/restore.sh +++ b/restore.sh @@ -133,6 +133,7 @@ curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - sudo apt update sudo apt install -y gcc g++ make sudo apt install -y nodejs +sudo npm install -g npm print_green 'Restoring Nginx' @@ -205,9 +206,8 @@ wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt- sudo apt update sudo apt install -y postgresql-13 sleep 2 - - - +sudo systemctl enable postgresql +sudo systemctl restart postgresql print_green 'Restoring MongoDB' diff --git a/update.sh b/update.sh index ac8d4c62..43f3a15c 100644 --- a/update.sh +++ b/update.sh @@ -172,6 +172,10 @@ printf >&2 "${GREEN}Stopping ${i} service...${NC}\n" sudo systemctl stop ${i} done +printf >&2 "${GREEN}Restarting postgresql database${NC}\n" +sudo systemctl restart postgresql +sleep 5 + rm -f /rmm/api/tacticalrmm/app.ini numprocs=$(nproc) @@ -255,6 +259,8 @@ if ! [[ $HAS_NATS220 ]]; then rm -rf ${nats_tmp} fi +sudo npm install -g npm + cd /rmm git config user.email "admin@example.com" git config user.name "Bob"