Skip to content

Commit

Permalink
JS image boots properly now (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
cardil authored Apr 14, 2023
1 parent a01a18c commit 2b0a547
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
15 changes: 14 additions & 1 deletion .github/workflows/container-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
with:
image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
containerfiles: ${{ steps.prep.outputs.containerfile }}
tags: ${{ steps.prep.outputs.tags }}
tags: ${{ steps.prep.outputs.tags }} ${{ github.sha }}
platforms: ${{ steps.prep.outputs.platforms }}
build-args: |
CONTEXT_DIR=./${{ matrix.app }}/
Expand All @@ -82,6 +82,19 @@ jobs:
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.licenses=${{ github.event.repository.license.spdx_id }}
- name: Test the built container
run: |
set -Eeuxo pipefail
podman run --rm \
-d \
--name showcase \
-u 10001 \
-p 38080:8080 \
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
trap 'podman kill showcase' EXIT
curl --retry-all-errors --retry 8 -v -L --fail \
http://localhost:38080/
- name: Login to registry
uses: redhat-actions/podman-login@v1
if: ${{ steps.prep.outputs.push == 'true' }}
Expand Down
2 changes: 1 addition & 1 deletion expressjs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ build:
npm run build

clean: frontend.clean
rm -rfv build
rm -rfv build public
rm -rf node_modules

frontend: frontend.build
Expand Down
2 changes: 1 addition & 1 deletion expressjs/src/lib/project.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const { isDirectory } = require('./fs.js')
const packageJson = require('../../package.json')
const { gitDescribeSync } = require('git-describe')

class Project {
constructor({ group, artifact, version, platform }) {
Expand Down Expand Up @@ -28,6 +27,7 @@ class Project {
}

async function resolveGitDescribe() {
const { gitDescribeSync } = require('git-describe')
return gitDescribeSync(__dirname)
.raw
.replace(/-dirty$/, '')
Expand Down

0 comments on commit 2b0a547

Please sign in to comment.