Skip to content

Commit

Permalink
wip: Upgrade NodeJS to v20 (#278)
Browse files Browse the repository at this point in the history
  • Loading branch information
claustres committed Jun 14, 2024
1 parent 5d6a7e7 commit 34543b4
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ jobs:
run: bash ./scripts/run_tests.sh -n ${{ matrix.node }} -m ${{ matrix.mongo }}

build_app:
strategy:
fail-fast: false
matrix:
node: [ 20 ]
debian: [ 'bookworm' ]
name: Build app
if: ${{ !contains(github.event.head_commit.message, 'skip app') }}
runs-on: ubuntu-22.04
Expand All @@ -65,7 +70,7 @@ jobs:
- name: Build app
env:
SOPS_AGE_KEY: ${{ secrets.SOPS_AGE_KEY }}
run: bash ./scripts/build_app.sh -p -r ${{ github.job }}
run: bash ./scripts/build_app.sh -n ${{ matrix.node }} -d ${{ matrix.debian }} -p -r ${{ github.job }}

build_docs:
name: Build docs
Expand Down
6 changes: 4 additions & 2 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
ARG DEBIAN_VERSION=bookworm
ARG NODE_VERSION=20
#
# Use a builder to build the Krawler
#
FROM node:16-bookworm AS builder
FROM node:${NODE_VERSION}-${DEBIAN_VERSION} AS builder
# Install krawler
COPY . /opt/krawler
WORKDIR /opt/krawler
Expand All @@ -11,7 +13,7 @@ RUN yarn
#
# Make a slim image and copy from the build
#
FROM node:16-bookworm-slim
FROM node:${NODE_VERSION}-${DEBIAN_VERSION}-slim
LABEL maintainer="Kalisio <[email protected]>"

# Install Krawler, change owner to 'node' user
Expand Down
14 changes: 11 additions & 3 deletions scripts/build_app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,18 @@ WORKSPACE_DIR="$(dirname "$ROOT_DIR")"
## Parse options
##

NODE_VER=20
DEBIAN_VER=bookworm
PUBLISH=false
CI_STEP_NAME="Build app"
while getopts "pr:" option; do
while getopts "d:n:pr:" option; do
case $option in
d) # defines debian version
DEBIAN_VER=$OPTARG
;;
n) # defines node version
NODE_VER=$OPTARG
;;
p) # publish app
PUBLISH=true
;;
Expand Down Expand Up @@ -49,9 +57,9 @@ load_value_files "$WORKSPACE_DIR/development/common/KALISIO_DOCKERHUB_PASSWORD.e
# Remove trailing @ in module name
IMAGE_NAME="$KALISIO_DOCKERHUB_URL/${APP:1}"
if [[ -z "$GIT_TAG" ]]; then
IMAGE_TAG=latest
IMAGE_TAG="latest-node$NODE_VER-$DEBIAN_VER"
else
IMAGE_TAG=$VERSION
IMAGE_TAG="$VERSION-node$NODE_VER-$DEBIAN_VER"
fi

begin_group "Building container $IMAGE_NAME:$IMAGE_TAG ..."
Expand Down

0 comments on commit 34543b4

Please sign in to comment.