diff --git a/.github/workflows/sync-nodejs-versions.yml b/.github/workflows/sync-nodejs-versions.yml new file mode 100644 index 0000000000..a8743b6750 --- /dev/null +++ b/.github/workflows/sync-nodejs-versions.yml @@ -0,0 +1,24 @@ +name: Sync Node.js versions +on: + pull_request: + paths: + - 'Dockerfile' +jobs: + sync-node-version: + runs-on: ubuntu-latest + # if: github.actor == 'dependabot[bot]' + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} + token: ${{ secrets.GITHUB_TOKEN }} + - name: Update .nvmrc + run: | + grep -o -P '(?<=FROM node:)\d+.?\d*.?\d*' Dockerfile > .nvmrc + - name: Commit changes + run: | + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + git add .nvmrc + git commit -m "chore: sync .nvmrc with Dockerfile node version" || exit 1 + git push diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000000..d9df1bbc0c --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +0.11.0 diff --git a/Dockerfile b/Dockerfile index 0da13db1c6..4dbed9e3c5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ ######################################################################################################################## ######################################################################################################################## -FROM node:23.1.0 AS updated-local +FROM node:24.1.0 AS updated-local ENV TZ=Europe/Amsterdam ENV CI=true diff --git a/readme.md b/readme.md index bc8de71d24..8c557a9a82 100644 --- a/readme.md +++ b/readme.md @@ -10,14 +10,23 @@ is a portal for official communication with the municipality of Amsterdam. The a To see the application quickly running locally, clone the repo and cd into the project folder. Inside the project folder create a new file called `.env.local`. Put the keys from `.env.local.template` inside the file AND ask one of the developers for possible additional values. -## Running localy +## Set-up -Put the following commands in your terminal: +We use Node, and to install the latest version, follow the instructions in this [Link](https://github.com/nvm-sh/nvm?tab=readme-ov-file#installing-and-updating).
+Then execute the following commands in a bash terminal to install it and the rest of our dependencies: ```bash cp -i .env.local.template .env.local +nvm install npm install -g ts-node nodemon npm install +``` + +## Running locally + +Put the following commands in your terminal after all dependencies are installed: + +```bash npm run serve-dev npm start ``` diff --git a/src/server/routing/router-public.ts b/src/server/routing/router-public.ts index cbc104062a..0fa7524be3 100644 --- a/src/server/routing/router-public.ts +++ b/src/server/routing/router-public.ts @@ -29,6 +29,7 @@ import { QueryParamsMaintenanceNotifications, fetchMaintenanceNotificationsActual, } from '../services/cms-maintenance-notifications'; +import { getFromEnv } from '../helpers/env'; export const router = express.Router(); @@ -200,14 +201,17 @@ export async function zaakStatusHandler( return res.redirect(loginRouteWithReturnTo); } +const gitSHA = getFromEnv('MA_GIT_SHA', false) ?? -1; + router.get( [BffEndpoints.ROOT, BffEndpoints.STATUS_HEALTH], - (req: Request, res: Response, next: NextFunction) => { + (_req: Request, res: Response) => { return res.json({ status: 'OK', otapEnv: OTAP_ENV, release: RELEASE_VERSION, - gitSha: process.env.MA_GIT_SHA ?? '-1', + gitSha: gitSHA, + gitShaUrl: `https://github.com/Amsterdam/mijn-amsterdam-frontend/commit/${gitSHA}`, buildId: process.env.MA_BUILD_ID ?? '-1', }); }