From b25ab14385375548fdf95ebe41d45dd40d9e4059 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Sun, 8 Dec 2024 13:30:39 +0100 Subject: [PATCH] Pin node to version 22.11 (#5582) * Add --rm to all docker run commands in CI * Pin node 22 version to 22.11 --- .github/workflows/ci.yml | 2 +- tests/test_docker.sh | 14 +++++++------- .../compose/local/node/Dockerfile | 2 +- {{cookiecutter.project_slug}}/package.json | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0c269fa1d7..b7375205eb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -109,6 +109,6 @@ jobs: run: uv sync - uses: actions/setup-node@v4 with: - node-version: "22" + node-version: "22.11" - name: Bare Metal ${{ matrix.script.name }} run: sh tests/test_bare.sh ${{ matrix.script.args }} diff --git a/tests/test_docker.sh b/tests/test_docker.sh index 326e583286..171e0c8097 100755 --- a/tests/test_docker.sh +++ b/tests/test_docker.sh @@ -18,19 +18,19 @@ cd my_awesome_project docker compose -f docker-compose.local.yml build # run the project's type checks -docker compose -f docker-compose.local.yml run django mypy my_awesome_project +docker compose -f docker-compose.local.yml run --rm django mypy my_awesome_project # run the project's tests -docker compose -f docker-compose.local.yml run django pytest +docker compose -f docker-compose.local.yml run --rm django pytest # return non-zero status code if there are migrations that have not been created -docker compose -f docker-compose.local.yml run django python manage.py makemigrations --check || { echo "ERROR: there were changes in the models, but migration listed above have not been created and are not saved in version control"; exit 1; } +docker compose -f docker-compose.local.yml run --rm django python manage.py makemigrations --check || { echo "ERROR: there were changes in the models, but migration listed above have not been created and are not saved in version control"; exit 1; } # Test support for translations -docker compose -f docker-compose.local.yml run django python manage.py makemessages --all +docker compose -f docker-compose.local.yml run --rm django python manage.py makemessages --all # Make sure the check doesn't raise any warnings -docker compose -f docker-compose.local.yml run \ +docker compose -f docker-compose.local.yml run --rm \ -e DJANGO_SECRET_KEY="$(openssl rand -base64 64)" \ -e REDIS_URL=redis://redis:6379/0 \ -e DJANGO_AWS_ACCESS_KEY_ID=x \ @@ -42,10 +42,10 @@ docker compose -f docker-compose.local.yml run \ django python manage.py check --settings=config.settings.production --deploy --database default --fail-level WARNING # Generate the HTML for the documentation -docker compose -f docker-compose.docs.yml run docs make html +docker compose -f docker-compose.docs.yml run --rm docs make html # Run npm build script if package.json is present if [ -f "package.json" ] then - docker compose -f docker-compose.local.yml run node npm run build + docker compose -f docker-compose.local.yml run --rm node npm run build fi diff --git a/{{cookiecutter.project_slug}}/compose/local/node/Dockerfile b/{{cookiecutter.project_slug}}/compose/local/node/Dockerfile index b0142ff81f..b749e5516b 100644 --- a/{{cookiecutter.project_slug}}/compose/local/node/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/local/node/Dockerfile @@ -1,4 +1,4 @@ -FROM docker.io/node:22-bookworm-slim +FROM docker.io/node:22.11-bookworm-slim WORKDIR /app diff --git a/{{cookiecutter.project_slug}}/package.json b/{{cookiecutter.project_slug}}/package.json index d0410f554a..fe94edd218 100644 --- a/{{cookiecutter.project_slug}}/package.json +++ b/{{cookiecutter.project_slug}}/package.json @@ -35,7 +35,7 @@ "webpack-merge": "^6.0.1" }, "engines": { - "node": "22" + "node": "22.11" }, "browserslist": [ "last 2 versions"