fix: remove use-node-version + update devops docs (#49636)

* fix: drop use-node-version + explain npmrc config

* docs(devops): go back to installing node directly

* docs(devops): update scripts + cleanup

* docs: add note about updating node

---------

Co-authored-by: Mrugesh Mohapatra <1884376+raisedadead@users.noreply.github.com>
This commit is contained in:
Oliver Eyton-Williams
2023-03-09 15:09:13 +01:00
committed by GitHub
parent 05266841f3
commit 3864d36e35
3 changed files with 44 additions and 30 deletions

7
.npmrc
View File

@@ -1,5 +1,8 @@
# Install peers for convenience
auto-install-peers=true
# Particularly since we're installing them automatically, we want to know about
# any conflicts
strict-peer-dependencies=true
# TODO: consider reworking the scripts to avoid usage of pre/post scripts
# A lot of our scripts rely on pre and post scripts, so this is necessary for
# now
enable-pre-post-scripts=true
use-node-version=18.14.2

View File

@@ -450,13 +450,15 @@ sudo apt install build-essential
Provisioning VMs with the Code
1. Install `pnpm` globally.
1. Install Node LTS.
2. Install pnpm globally.
```console
curl -fsSL https://get.pnpm.io/install.sh | sh -
npm install -g pnpm
```
2. Clone freeCodeCamp, setup env and keys.
3. Clone freeCodeCamp, setup env and keys.
```console
git clone https://github.com/freeCodeCamp/freeCodeCamp.git
@@ -464,9 +466,7 @@ Provisioning VMs with the Code
git checkout prod-current # or any other branch to be deployed
```
3. Create the `.env` from the secure credentials storage.
4. Create the `google-credentials.json` from the secure credentials storage.
4. Create the `.env` from the secure credentials storage.
5. Install dependencies
@@ -529,7 +529,7 @@ pnpm install
3. Build the server
```console
pnpm run create:config && pnpm run build:curriculum && pnpm run build:server
pnpm create:config && pnpm build:curriculum && pnpm build:server
```
4. Start Instances
@@ -541,12 +541,22 @@ pnpm start:server && pnpm pm2 logs
#### 2. Rolling updates - Used for logical changes to code.
```console
pnpm pm2 reload api-server/ecosystem.config.js && pnpm pm2 logs
pnpm reload:server && pnpm pm2 logs
```
> [!NOTE] We are handling rolling updates to code, logic, via pipelines. You
> should not need to run these commands. These are here for documentation.
#### 3. Updating Node
1. Install new Node version
2. Update pm2 to use the new version
```console
pnpm pm2 update
```
## Work on Client Instances
1. Install build tools for node binaries (`node-gyp`) etc.

View File

@@ -74,13 +74,14 @@
"lint:js": "eslint --max-warnings 0 .",
"lint:ts": "tsc && tsc -p config && tsc -p tools/ui-components && tsc -p utils",
"lint:prettier": "prettier --list-different .",
"reload:server": "pm2 reload api-server/ecosystem.config.js",
"seed": "cross-env DEBUG=fcc:* node ./tools/scripts/seed/seed-demo-user",
"seed:certified-user": "cross-env DEBUG=fcc:* node ./tools/scripts/seed/seed-demo-user certified-user",
"serve:client": "cd ./client && pnpm run serve",
"serve:client-ci": "cd ./client && pnpm run serve-ci",
"start": "npm-run-all create:* -p develop:server serve:client",
"start-ci": "npm-run-all create:* -p start:server serve:client-ci",
"start:server": "pnpm pm2 start api-server/ecosystem.config.js",
"start:server": "pm2 start api-server/ecosystem.config.js",
"storybook": "cd ./tools/ui-components && pnpm run storybook",
"test": "run-s create:* build:curriculum build-workers test:*",
"test:source": "jest",