1
0
Fork 0

fix(build): make example test script compatible with container build targets

This commit is contained in:
ssube 2021-08-12 23:30:42 -05:00
parent ea562fa143
commit bbadd3e82c
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
3 changed files with 8 additions and 7 deletions

6
run.mk
View File

@ -32,11 +32,13 @@ test-rules: build-bundle
--tag salty-dog > /dev/null || exit 1; \
done
DOCKER_OPTIONS ?=
local-alpine:
docker run --rm -v "$(shell pwd):/salty-dog" -w /salty-dog node:16-stretch make ci
docker run $(DOCKER_OPTIONS) --rm -v "$(shell pwd):/salty-dog" -w /salty-dog node:16-alpine sh -c "apk add build-base git && make ci"
local-stretch:
docker run --rm -v "$(shell pwd):/salty-dog" -w /salty-dog node:16-alpine sh -c "apk add build-base git && make ci"
docker run $(DOCKER_OPTIONS) --rm -v "$(shell pwd):/salty-dog" -w /salty-dog node:16-stretch bash -c "make ci"
local-chown-leaks: ## clean up root-owned files the containers may leak
sudo chown -R ${USER}:${USER} $(ROOT_PATH)

View File

@ -1,4 +1,4 @@
#! /bin/bash
#! /bin/sh
PROJECT="${ROOT_PATH}"
PARENT="$(dirname "${PROJECT}")"

View File

@ -35,8 +35,9 @@ do
2> ${STDERR_PATH}
ACTUAL_STATUS=$?
echo "Test status: ${ACTUAL_STATUS}"
if [[ -s ${STDOUT_PATH} ]];
if [ -s ${STDOUT_PATH} ];
then
echo "Test output:"
echo "==="
@ -46,7 +47,7 @@ do
echo "==="
fi
if [[ -s ${STDERR_PATH} ]];
if [ -s ${STDERR_PATH} ];
then
echo "Test errors:"
echo "==="
@ -56,8 +57,6 @@ do
echo "==="
fi
echo "Test status: ${ACTUAL_STATUS}"
if [ "${ACTUAL_STATUS}" != "${EXPECTED_STATUS}" ];
then
echo "Exit status does not match! (expected ${EXPECTED_STATUS}, got ${ACTUAL_STATUS})"