diff --git a/.github/workflows/build-and-deploy-dev.yml b/.github/workflows/build-and-deploy-dev.yml index 86aa21dba..1f3dd177d 100644 --- a/.github/workflows/build-and-deploy-dev.yml +++ b/.github/workflows/build-and-deploy-dev.yml @@ -23,7 +23,7 @@ jobs: build-and-deploy: name: Build and Deploy needs: upload-package-lock-json - uses: clearlydefined/operations/.github/workflows/app-build-and-deploy.yml@v2.0.0 + uses: clearlydefined/operations/.github/workflows/app-build-and-deploy.yml@v3.0.0 secrets: AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} AZURE_WEBAPP_PUBLISH_PROFILE: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE_DEV }} diff --git a/DevDockerfile b/DevDockerfile index 00b490fc9..d11bd0d0c 100644 --- a/DevDockerfile +++ b/DevDockerfile @@ -15,8 +15,12 @@ ENV APPDIR=/opt/service # COPY init_container.sh /bin/ # RUN chmod 755 /bin/init_container.sh # CMD ["/bin/init_container.sh"] -ARG BUILD_NUMBER=0 -ENV BUILD_NUMBER=$BUILD_NUMBER + +# Set environment variables from build arguments +ARG APP_VERSION="UNKNOWN" +ENV APP_VERSION=$APP_VERSION +ARG BUILD_SHA="UNKNOWN" +ENV BUILD_SHA=$BUILD_SHA COPY patches /tmp/patches COPY .npmrc package*.json /tmp/ diff --git a/Dockerfile b/Dockerfile index f3b00009e..423b1df97 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,8 +15,12 @@ ENV APPDIR=/opt/service # COPY init_container.sh /bin/ # RUN chmod 755 /bin/init_container.sh # CMD ["/bin/init_container.sh"] -ARG BUILD_NUMBER=0 -ENV BUILD_NUMBER=$BUILD_NUMBER + +# Set environment variables from build arguments +ARG APP_VERSION="UNKNOWN" +ENV APP_VERSION=$APP_VERSION +ARG BUILD_SHA="UNKNOWN" +ENV BUILD_SHA=$BUILD_SHA COPY patches /tmp/patches COPY .npmrc package*.json /tmp/ diff --git a/app.js b/app.js index 846a54618..ce566c9cf 100644 --- a/app.js +++ b/app.js @@ -225,7 +225,7 @@ function createApp(config) { // Bit of trick for local hosting. Preload search if using an in-memory search service // Commenting out because I believe this is broken // if (searchService.constructor.name === 'MemorySearch') await definitionService.reload('definitions') - logger.info('Service initialized', { buildNumber: process.env.BUILD_NUMBER }) + logger.info('Service initialized', { appVersion: process.env.APP_VERSION }) // kick off the queue processors require('./providers/curation/process')(curationQueue, curationService, logger) diff --git a/routes/index.js b/routes/index.js index 72c7e6253..24ed370eb 100644 --- a/routes/index.js +++ b/routes/index.js @@ -4,7 +4,7 @@ const express = require('express') const router = express.Router() router.get('/', function (req, res) { - const msg = `{ "status": "OK", "version": "${version}", "sha": "${sha}"` + const msg = `{ "status": "OK", "version": "${version}", "sha": "${sha}" }` res.status(200).send(msg) })