When NodeJs is updated it is worth noting it needs to be updated in a few places.
There are a couple of considerations to consider when selecting a Node version to upgrade to:
- The version must be supported by the latest release of the ci-image-builder paketo-buildpacks/builder-jammy-full buildpack.
- The version must have a Cypress docker image associated with it, and appear in the list of Cypress image tags.
If both of these criteria are not met, it will not be possible to build the new dependency image locally and it will not be possible to proceed with the upgrade.
- Check the node version is supported by the platform team ci-image-builder package.
- Check the builder configuration for the latest version supported by the platform team: ci-image-builder
- Find that release in the paketo-buildpacks/builder-jammy-full repo.
- Expand the release to see all of the "Buildpacks".
- Find the paketo-buildpacks/node-engine buildpack, there may be more than one, pick the latest version. This is the package which installs Node.js
- Go the the paketo-buildpacks/node-engine releases page and find that release.
- Look at the dependencies for the supported node version and see if it matches the version you want.
- If it doesn't wait or investigate if we require using these buildpacks.
- Install and set your local
nvm
to use the chosen Node version
nvm install VERSION
nvm use VERSION
- Update the engines in
package.json
and install the dependencies withnpm ci
. - Update the version used in
Dockerfile.dependencies
, then create/upload a new version of the dependency image (use the instructions from the Docker readme). Ensure that theDockerfile
is using the image you created or CircleCI will not be able to run most of the tests. - Update the engines in
test/sandbox/package.json
and install the dependencies withnpm ci
. - Update the node versions used in the below files:
test/sandbox/Dockerfile
- Step two of the native readme
- Run the unit tests to check the app
npm run test:unit
, and then start the appnpm run develop
and do some quick smoke tests to ensure the app works - Commit your changes, push the branch and then create a Draft PR to get the tests running
- Deploy the branch to the UAT environment so we can test the buildpack.
- Once the tests pass and the deployment works, mark the PR as ready for review
- Switch back the Node version so you can carry on with other tickets whilst waiting for the PR to be approved and merged ;-)
- Once the PR has been merged, do a release to production to finish the process.