From d409194dd8e951df5e9238c26e0d729cc679aa2e Mon Sep 17 00:00:00 2001 From: Mrugesh Mohapatra <1884376+raisedadead@users.noreply.github.com> Date: Wed, 24 Nov 2021 23:11:11 +0530 Subject: [PATCH] docs: update instructions (#44267) * docs: update instructions * docs: update instructions * Update docs/devops.md Co-authored-by: Nicholas Carrigan (he/him) Co-authored-by: Nicholas Carrigan (he/him) --- docs/devops.md | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/docs/devops.md b/docs/devops.md index 2406efa94f..5d87a329fe 100644 --- a/docs/devops.md +++ b/docs/devops.md @@ -455,7 +455,7 @@ Provisioning VMs with the Code 2. Update `npm` and install PM2 and setup `logrotate` and startup on boot ```console - npm i -g npm@6 + npm i -g npm@8 npm i -g pm2 pm2 install pm2-logrotate pm2 startup @@ -830,7 +830,7 @@ nvm ls Install the latest Node.js LTS, and reinstall any global packages ```console -nvm install 'lts/*' --reinstall-packages-from=default +nvm install --lts --reinstall-packages-from=default ``` Verify installed packages @@ -839,10 +839,10 @@ Verify installed packages npm ls -g --depth=0 ``` -Alias the `default` Node.js version to the current LTS +Alias the `default` Node.js version to the current LTS (pinned to latest major version) ```console -nvm alias default lts/* +nvm alias default 16 ``` (Optional) Uninstall old versions @@ -851,9 +851,23 @@ nvm alias default lts/* nvm uninstall ``` -> [!WARNING] +> [!ATTENTION] +> For client applications, the shell script can't be resurrected between Node.js versions with `pm2 resurrect`. Deploy processes from scratch instead. This should become nicer when we move to a docker based setup. +> > If using PM2 for processes you would also need to bring up the applications and save the process list for automatic recovery on restarts. +Get the uninstall instructions/commands with the `unstartup` command and use the output to remove the systemctl services + +```console +pm2 unstartup +``` + +Get the install instructions/commands with the `startup` command and use the output to add the systemctl services + +```console +pm2 startup +``` + Quick commands for PM2 to list, resurrect saved processes, etc. ```console @@ -872,9 +886,6 @@ pm2 save pm2 logs ``` -> [!ATTENTION] -> For client applications, the shell script can't be resurrected between Node.js versions with `pm2 resurrect`. Deploy processes from scratch instead. This should become nicer when we move to a docker based setup. - ## Installing and Updating Azure Pipeline Agents See: https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/v2-linux?view=azure-devops and follow the instructions to stop, remove and reinstall agents. Broadly you can follow the steps listed here.