Skip to content

Commit

Permalink
Merge pull request #28 from gurucomputing/17-version-info-doesnt-make…
Browse files Browse the repository at this point in the history
…-it-into-the-final-build

17 version info doesnt make it into the final build
  • Loading branch information
routerino authored Aug 7, 2022
2 parents 29288b5 + 346e233 commit 827d719
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/publish-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ jobs:
$(docker manifest inspect ghcr.io/${{ github.repository }}:$VERSION > /dev/null) || NOT_PREVIOUSLY_PUBLISHED=1
echo "::set-output name=NOT_PREVIOUSLY_PUBLISHED::$NOT_PREVIOUSLY_PUBLISHED"
- name: Update Version in Code
run: |
sed -i 's/insert-version/${{ steps.gathervars.outputs.VERSION }}/g' ./src/routes/settings.html.svelte
- name: Log in to the Container registry
uses: docker/login-action@v1
if: ${{ steps.gathervars.outputs.NOT_PREVIOUSLY_PUBLISHED != 0 }}
Expand Down
6 changes: 5 additions & 1 deletion docker/production/dockerfile
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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
Expand Down
9 changes: 9 additions & 0 deletions docker/production/scripts/1-image-build.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
#!/bin/sh
set -x

# add dependencies
# jq for parsing version information
# git for cloning the repository
apk add --no-cache jq git

#clone the project
git clone ${PROJECT_URL} ${PROJECT_NAME}

# install the project
cd ${PROJECT_NAME}
npm install

# inject the version number
VERSION=$(jq -r '.version' package.json)
sed -i "s/insert-version/${VERSION}/g" ./src/routes/settings.html.svelte

# build the project
npm run build

0 comments on commit 827d719

Please sign in to comment.