Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ubuntu 20.04 #68

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 24 additions & 13 deletions deployll.sh
Original file line number Diff line number Diff line change
Expand Up @@ -717,15 +717,21 @@ function debian_install ()
fi
fi


INSTALL_NODE=false
if [[ ! `command -v nodejs` ]]; then

if [[ `command -v node` ]]; then
NODE_COMMAND="node"
fi

if [[ ! `command -v $NODE_COMMAND` ]]; then
INSTALL_NODE=true
output_log "installing nodejs"
elif [[ `nodejs --version | cut -d'.' -f 1` != $NODE_VERSION_STRING ]]; then
elif [[ `$NODE_COMMAND --version | cut -d'.' -f 1` != $NODE_VERSION_STRING ]]; then
INSTALL_NODE=true
output_log "updating nodejs"
else
CUR_NODE_VERSION=`nodejs --version | cut -d'.' -f 1`
CUR_NODE_VERSION=`$NODE_COMMAND --version | cut -d'.' -f 1`
output_log "current node version is found as ${CUR_NODE_VERSION}"
fi

Expand All @@ -736,20 +742,20 @@ function debian_install ()
output "Node.js already installed"
fi

if [[ `command -v node` ]]; then
NODE_COMMAND="node"
fi

if [[ `nodejs --version | cut -d'.' -f 1` != $NODE_VERSION_STRING ]]; then
if [[ `$NODE_COMMAND --version | cut -d'.' -f 1` != $NODE_VERSION_STRING ]]; then
output "Something went wrong in installing/updating nodejs. This is likely a fault in your apt config. Can't continue"
exit 0
fi


INSTALLED_NODE_VERSION=`nodejs --version`
INSTALLED_NODE_VERSION=`$NODE_COMMAND --version`
if [[ $INSTALLED_NODE_VERSION == "" ]]; then
INSTALLED_NODE_VERSION=`node --version`
if [[ $INSTALLED_NODE_VERSION == "" ]]; then
output "ERROR :: node doesn't seem to be installed - exiting"
exit 1
fi
output "ERROR :: node doesn't seem to be installed - exiting"
exit 1
fi
output "node version - $INSTALLED_NODE_VERSION"

Expand Down Expand Up @@ -841,14 +847,18 @@ function debian_mongo ()
if [[ $OS_VNO == "18.04" ]]; then
echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-4.0.list
fi
if [[ $OS_VNO == "20.04" ]]; then
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 20691eec35216c63caf66ce1656408e390cfb1f5 >> $OUTPUT_LOG 2>>$ERROR_LOG
echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-4.4.list
fi
apt-get update >> $OUTPUT_LOG 2>>$ERROR_LOG
systemctl unmask mongod
apt-get -qq -y install mongodb-org >> $OUTPUT_LOG 2>>$ERROR_LOG
# Attempt to start via both services - one will likely fail but
output "Attempting to start mongod service...."
output "If this fails you will need to check how the Mongo service is setup for your system and manually start it"
service mongod start
systemctl enable mongod.service
systemctl daemon-reload
systemctl enable mongod
systemctl start mongod
D_M_I=true
fi

Expand Down Expand Up @@ -1218,6 +1228,7 @@ PM2_OVERRIDE=false
NODE_OVERRIDE=false
NODE_VERSION=10.x
NODE_VERSION_STRING=v10
NODE_COMMAND="nodejs"
UPDATE_MODE=false
GIT_ASK=false
GIT_REV=false
Expand Down