From 0dd86af01da808ce1c820fa702e2f9bbc8e92a0c Mon Sep 17 00:00:00 2001 From: Nico Hanus Date: Tue, 23 Jun 2020 14:32:27 +0200 Subject: [PATCH] added version in docker to npm package.json --- Dockerfile | 2 ++ azure-pipelines.yml | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 870eeb1dd..1ee69942c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,11 @@ #stage 1 FROM node:10-stretch as node ARG IS_PRODUCTION=false +ARG SEMVERSION=1.0.0 WORKDIR /app COPY . . RUN umask 0022 +RUN npm version ${SEMVERSION} RUN npm install --always-auth=false RUN if [ "${IS_PRODUCTION}" = "true" ] ; then npm run-script build-prod ; else npm run-script build ; fi diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7e84b5744..b48a3d061 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -36,7 +36,7 @@ jobs: Dockerfile: Dockerfile buildContext: tags: '$(Build.BuildNumber)-$(Build.SourceVersion)' - arguments: '--pull' + arguments: '--build-arg SEMVERSION=$(Major).$(Minor).$(Patch)' - job: cibuild_debug displayName: ISAClient CI Debug @@ -60,7 +60,7 @@ jobs: Dockerfile: Dockerfile buildContext: tags: 'debug-$(Build.BuildNumber)-$(Build.SourceVersion)' - arguments: '--no-cache --pull' + arguments: '--no-cache --build-arg SEMVERSION=$(Major).$(Minor).$(Patch)' - task: Docker@2 displayName: 'push ISAClient Debug' @@ -104,7 +104,7 @@ jobs: Dockerfile: Dockerfile buildContext: tags: 'prod-$(Build.BuildNumber)-$(Build.SourceVersion)' - arguments: '--pull --no-cache --build-arg IS_PRODUCTION=true' + arguments: '--no-cache --build-arg IS_PRODUCTION=true --build-arg SEMVERSION=$(Major).$(Minor).$(Patch)' - task: Docker@2 displayName: 'push ISAClient Prod'