From 91815072d597181b0a08bfc13cf40025de0f11cc Mon Sep 17 00:00:00 2001 From: wiz Date: Fri, 18 Sep 2020 21:53:58 +0900 Subject: [PATCH] Update production scripts to install/load NodeJS/npm using nvm --- production/README.md | 10 ++++++++++ production/mempool-install-all | 2 ++ production/mempool-start-all | 2 ++ production/mempool-upgrade-all | 11 +++++++++-- 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/production/README.md b/production/README.md index 61518ed31..8241122b8 100644 --- a/production/README.md +++ b/production/README.md @@ -68,6 +68,16 @@ pkg install -y boost-libs autoconf automake gmake gcc libevent libtool pkgconf pkg install -y mariadb55-server mariadb55-client nginx py37-certbot-nginx npm ``` +### NodeJS / npm + +I recommend to build nodejs / npm from source using nvm: +``` +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | zsh +source $HOME/.zshrc +nvm install node +nvm alias default node +``` + ### Rust I recommend to build rust from latest source: diff --git a/production/mempool-install-all b/production/mempool-install-all index d35f1ade7..47f38dc70 100755 --- a/production/mempool-install-all +++ b/production/mempool-install-all @@ -1,4 +1,6 @@ #!/usr/local/bin/zsh +export NVM_DIR="$HOME/.nvm" +source "$NVM_DIR/nvm.sh" for site in mainnet liquid testnet bisq do git clone https://github.com/mempool/mempool "${HOME}/${site}" diff --git a/production/mempool-start-all b/production/mempool-start-all index 178b41e0a..338197b5a 100755 --- a/production/mempool-start-all +++ b/production/mempool-start-all @@ -1,4 +1,6 @@ #!/usr/local/bin/zsh +export NVM_DIR="$HOME/.nvm" +source "$NVM_DIR/nvm.sh" for site in mainnet liquid testnet bisq do cd "${HOME}/${site}/backend/" diff --git a/production/mempool-upgrade-all b/production/mempool-upgrade-all index 084d1f038..d9e8fa04e 100755 --- a/production/mempool-upgrade-all +++ b/production/mempool-upgrade-all @@ -1,10 +1,17 @@ #!/usr/local/bin/zsh -x PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:$HOME/bin -[ -f $HOME/lock ] && exit 1 +if [ -f $HOME/lock ];then + echo "check lockfile" + exit 1 +fi + touch $HOME/lock -echo 'rebuilding mempool sites'|wall +export NVM_DIR="$HOME/.nvm" +source "$NVM_DIR/nvm.sh" + +echo 'upgrading mempool'|wall cd "$HOME/mempool" git pull --rebase origin master