From 6aaf7ecc26cf96abad8e86614ca34fc616a7e418 Mon Sep 17 00:00:00 2001 From: BlackDex Date: Sun, 4 Apr 2021 15:58:06 +0200 Subject: [PATCH] Add bwrs-version.json based upon latest tag. - Add a bwrs-version.json based upon the latest tag of the bw_web_builds (Assuming a build is started/created after a new tag is created). - Updated node version to latest LTS, v13 is EOL, v14 is LTS until 2023-04-30 ( https://nodejs.org/en/about/releases/ ) --- Dockerfile | 6 +++++- package_web_vault.sh | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 01b9179..0ed8376 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ # docker cp $image_id:/bw_web_vault.tar.gz . # docker rm $image_id -FROM node:13.8.0-stretch as build +FROM node:14.16.0-buster as build # Prepare the folder to enable non-root, otherwise npm will refuse to run the postinstall RUN mkdir /vault @@ -40,6 +40,10 @@ RUN npm install RUN npm audit fix RUN npm run dist +RUN printf '{"version":"%s"}' \ + $(git -c 'versionsort.suffix=-' ls-remote --tags --sort='v:refname' https://github.com/dani-garcia/bw_web_builds.git 'v*' | tail -n1 | sed -E 's#.*?refs/tags/v##') \ + > build/bwrs-version.json + # Delete debugging map files, optional # RUN find build -name "*.map" -delete diff --git a/package_web_vault.sh b/package_web_vault.sh index 94bca9c..1ca3387 100755 --- a/package_web_vault.sh +++ b/package_web_vault.sh @@ -46,11 +46,17 @@ git submodule update --recursive --init # Build npm install +npm audit fix npm run dist # Delete debugging map files, optional #find build -name "*.map" -delete +# Create bwrs-version.json with the latest tag from the remote repo. +printf '{"version":"%s"}' \ + $(git -c 'versionsort.suffix=-' ls-remote --tags --sort='v:refname' https://github.com/dani-garcia/bw_web_builds.git 'v*' | tail -n1 | sed -E 's#.*?refs/tags/v##') \ + > build/bwrs-version.json + # Prepare the final archives mv build web-vault tar -czvf "../$OUTPUT_NAME" web-vault --owner=0 --group=0