From f6b6b3b9b20c4a9bdf5798a63f419269215dc0cf Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Thu, 14 Nov 2024 11:40:12 +0100 Subject: [PATCH] =?UTF-8?q?=E2=AC=86=EF=B8=8F(front)=20upgrade=20to=20node?= =?UTF-8?q?=2016?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We need node 16 to use node-sass --- .circleci/config.yml | 30 ++++++++++++++---------------- Dockerfile | 2 +- docker-compose.yml | 2 +- 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1b25a939..5a137929 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -96,8 +96,7 @@ jobs: # Generate a version.json file describing app release - <<: *generate-version-file # Activate docker-in-docker - - setup_remote_docker: - version: 19.03.13 + - setup_remote_docker # Each image is tagged with the current git commit sha1 to avoid collisions in parallel builds. - run: name: Build production image @@ -266,8 +265,7 @@ jobs: # Generate a version.json file describing app release - <<: *generate-version-file # Activate docker-in-docker - - setup_remote_docker: - version: 19.03.13 + - setup_remote_docker - run: name: Build production image command: docker build -t ashley:${CIRCLE_SHA1} --target production . @@ -328,15 +326,15 @@ jobs: # ---- Front-end jobs ---- build-front: docker: - - image: circleci/node:14 + - image: circleci/node:16 working_directory: ~/fun/src/frontend steps: - checkout: path: ~/fun - restore_cache: keys: - - v3-front-dependencies-{{ checksum "yarn.lock" }} - - v3-front-dependencies + - v4-front-dependencies-{{ checksum "yarn.lock" }} + - v4-front-dependencies # If the yarn.lock file is not up-to-date with the package.json file, # using the --frozen-lockfile should fail. - run: @@ -358,19 +356,19 @@ jobs: - save_cache: paths: - ./node_modules - key: v3-front-dependencies-{{ checksum "yarn.lock" }} + key: v4-front-dependencies-{{ checksum "yarn.lock" }} build-front-production: docker: - - image: circleci/node:14 + - image: circleci/node:16 working_directory: ~/fun/src/frontend steps: - checkout: path: ~/fun - restore_cache: keys: - - v3-front-dependencies-{{ checksum "yarn.lock" }} - - v3-front-dependencies- + - v4-front-dependencies-{{ checksum "yarn.lock" }} + - v4-front-dependencies- - run: name: Build front-end application in production mode command: yarn build-production @@ -397,14 +395,14 @@ jobs: - src/ashley/static/ashley/font/* lint-front: docker: - - image: circleci/node:14 + - image: circleci/node:16 working_directory: ~/fun/src/frontend steps: - checkout: path: ~/fun - restore_cache: keys: - - v3-front-dependencies-{{ checksum "yarn.lock" }} + - v4-front-dependencies-{{ checksum "yarn.lock" }} - run: name: Lint code with tslint command: yarn lint @@ -414,14 +412,14 @@ jobs: test-front: docker: - - image: circleci/node:14 + - image: circleci/node:16 working_directory: ~/fun/src/frontend steps: - checkout: path: ~/fun - restore_cache: keys: - - v3-front-dependencies-{{ checksum "yarn.lock" }} + - v4-front-dependencies-{{ checksum "yarn.lock" }} - run: name: Run tests # Circle CI needs the tests to be run sequentially, otherwise it hangs. See Jest docs below: @@ -430,7 +428,7 @@ jobs: test-front-package: docker: - - image: circleci/node:14 + - image: circleci/node:16 working_directory: ~/wrk steps: - checkout: diff --git a/Dockerfile b/Dockerfile index 1dbf0a2a..ab0c23e1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,7 +21,7 @@ FROM python:3.8-slim AS base RUN pip install --upgrade pip # ---- Front-end builder image ---- -FROM node:14 AS front-builder +FROM node:16 AS front-builder # Copy frontend app sources COPY ./src/frontend /builder/src/frontend diff --git a/docker-compose.yml b/docker-compose.yml index 7fc51334..8ea548e0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -46,7 +46,7 @@ services: working_dir: /app node: - image: node:14 + image: node:16 working_dir: /app/src/frontend user: "${DOCKER_USER:-1000}" volumes: