From ff1ec611be9d2b28b02f3bb8d49f92e9bd38f5f0 Mon Sep 17 00:00:00 2001 From: Fabio Cigliano Date: Tue, 3 Jul 2018 03:38:36 +1200 Subject: [PATCH] lamassu-update script changes to update supervisor config (#133) * lamassu-update script changes to update supervisor config * No need to do supervisor start --- bin/lamassu-update | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/bin/lamassu-update b/bin/lamassu-update index 985f9dd8..9db5d02a 100755 --- a/bin/lamassu-update +++ b/bin/lamassu-update @@ -32,7 +32,7 @@ supervisorctl stop lamassu-admin-server >> ${LOG_FILE} 2>&1 decho "updating node" npm install n -g >> ${LOG_FILE} 2>&1 n lts >> ${LOG_FILE} 2>&1 -node -v +decho "version installed $(node -v)" decho "updating lamassu-server" npm -g install lamassu/lamassu-server#v5 --unsafe-perm >> ${LOG_FILE} 2>&1 @@ -45,6 +45,11 @@ decho "running migration" lamassu-migrate >> ${LOG_FILE} 2>&1 lamassu-migrate-config >> ${LOG_FILE} 2>&1 -decho "starting lamassu-server" -supervisorctl start lamassu-server >> ${LOG_FILE} 2>&1 -supervisorctl start lamassu-admin-server >> ${LOG_FILE} 2>&1 +decho "updating supervisor conf" +export NPM_BIN=$(npm -g bin) +perl -i -pe 's/command=.*/command=$ENV{NPM_BIN}\/lamassu-server/g' /etc/supervisor/conf.d/lamassu-server.conf >> ${LOG_FILE} 2>&1 +perl -i -pe 's/command=.*/command=$ENV{NPM_BIN}\/lamassu-admin-server/g' /etc/supervisor/conf.d/lamassu-admin-server.conf >> ${LOG_FILE} 2>&1 + +decho "updating lamassu-server" +supervisorctl update lamassu-server >> ${LOG_FILE} 2>&1 +supervisorctl update lamassu-admin-server >> ${LOG_FILE} 2>&1