Merge pull request #33 from BlackDex/bwrs-version-file

Add bwrs-version.json based upon latest tag.
This commit is contained in:
Daniel García 2021-04-06 17:58:01 +02:00 committed by GitHub
commit fe86339e17
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View file

@ -12,7 +12,7 @@
# docker cp $image_id:/bw_web_vault.tar.gz . # docker cp $image_id:/bw_web_vault.tar.gz .
# docker rm $image_id # 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 # Prepare the folder to enable non-root, otherwise npm will refuse to run the postinstall
RUN mkdir /vault RUN mkdir /vault
@ -40,6 +40,10 @@ RUN npm install
RUN npm audit fix RUN npm audit fix
RUN npm run dist 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 # Delete debugging map files, optional
# RUN find build -name "*.map" -delete # RUN find build -name "*.map" -delete

View file

@ -46,11 +46,17 @@ git submodule update --recursive --init
# Build # Build
npm install npm install
npm audit fix
npm run dist npm run dist
# Delete debugging map files, optional # Delete debugging map files, optional
#find build -name "*.map" -delete #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 # Prepare the final archives
mv build web-vault mv build web-vault
tar -czvf "../$OUTPUT_NAME" web-vault --owner=0 --group=0 tar -czvf "../$OUTPUT_NAME" web-vault --owner=0 --group=0