added jq to image, moved build image to alpine

This commit is contained in:
Christopher Bisset 2022-08-08 09:22:47 +10:00
parent 9db27aaa28
commit 022b6855a8
2 changed files with 11 additions and 2 deletions

View file

@ -1,7 +1,7 @@
# arguments
ARG VERSION="master"
FROM node:latest AS build
FROM node:current-alpine AS build
#environment variables
ENV PROJECT_NAME="headscale-ui"
@ -24,6 +24,10 @@ RUN chmod -R 755 scripts
# Build the image. This build runs as root
RUN /staging/scripts/1-image-build.sh
#####
## Second Image
#####
FROM alpine:latest
#environment variables

View file

@ -4,12 +4,17 @@ set -x
#clone the project
git clone ${PROJECT_URL} ${PROJECT_NAME}
# add dependencies
# jq for parsing version information
apk add --no-cache jq
# install the project
cd ${PROJECT_NAME}
npm install
# inject the version number
sed -i 's/insert-version/${{ steps.gathervars.outputs.VERSION }}/g' ./src/routes/settings.html.svelte
VERSION=$(jq -r '.version' package.json)
sed -i "s/insert-version/${VERSION}/g" ./src/routes/settings.html.svelte
# build the project
npm run build