diff --git a/DevDockerfile b/DevDockerfile index 00b490fc..8cb4d0d4 100644 --- a/DevDockerfile +++ b/DevDockerfile @@ -15,8 +15,14 @@ ENV APPDIR=/opt/service # COPY init_container.sh /bin/ # RUN chmod 755 /bin/init_container.sh # CMD ["/bin/init_container.sh"] + +# Set environment variables from build arguments ARG BUILD_NUMBER=0 -ENV BUILD_NUMBER=$BUILD_NUMBER +ENV BUILD_NUMBER=$APP_VERSION +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 f3b00009..73030d99 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,8 +15,14 @@ ENV APPDIR=/opt/service # COPY init_container.sh /bin/ # RUN chmod 755 /bin/init_container.sh # CMD ["/bin/init_container.sh"] + +# Set environment variables from build arguments ARG BUILD_NUMBER=0 -ENV BUILD_NUMBER=$BUILD_NUMBER +ENV BUILD_NUMBER=$APP_VERSION +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/routes/index.js b/routes/index.js index 72c7e625..24ed370e 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) })