Skip to content

Commit

Permalink
add APP_VERSION & BUILD_SHA to Dockerfiles
Browse files Browse the repository at this point in the history
add closing curly brace to status message
  • Loading branch information
elrayle committed Sep 30, 2024
1 parent c008d00 commit 3831bd0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
8 changes: 7 additions & 1 deletion DevDockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
8 changes: 7 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
2 changes: 1 addition & 1 deletion routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})

Expand Down

0 comments on commit 3831bd0

Please sign in to comment.