fix(build): make example test script compatible with container build targets
This commit is contained in:
parent
ea562fa143
commit
bbadd3e82c
6
run.mk
6
run.mk
|
@ -32,11 +32,13 @@ test-rules: build-bundle
|
||||||
--tag salty-dog > /dev/null || exit 1; \
|
--tag salty-dog > /dev/null || exit 1; \
|
||||||
done
|
done
|
||||||
|
|
||||||
|
DOCKER_OPTIONS ?=
|
||||||
|
|
||||||
local-alpine:
|
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:
|
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
|
local-chown-leaks: ## clean up root-owned files the containers may leak
|
||||||
sudo chown -R ${USER}:${USER} $(ROOT_PATH)
|
sudo chown -R ${USER}:${USER} $(ROOT_PATH)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#! /bin/bash
|
#! /bin/sh
|
||||||
|
|
||||||
PROJECT="${ROOT_PATH}"
|
PROJECT="${ROOT_PATH}"
|
||||||
PARENT="$(dirname "${PROJECT}")"
|
PARENT="$(dirname "${PROJECT}")"
|
||||||
|
|
|
@ -35,8 +35,9 @@ do
|
||||||
2> ${STDERR_PATH}
|
2> ${STDERR_PATH}
|
||||||
|
|
||||||
ACTUAL_STATUS=$?
|
ACTUAL_STATUS=$?
|
||||||
|
echo "Test status: ${ACTUAL_STATUS}"
|
||||||
|
|
||||||
if [[ -s ${STDOUT_PATH} ]];
|
if [ -s ${STDOUT_PATH} ];
|
||||||
then
|
then
|
||||||
echo "Test output:"
|
echo "Test output:"
|
||||||
echo "==="
|
echo "==="
|
||||||
|
@ -46,7 +47,7 @@ do
|
||||||
echo "==="
|
echo "==="
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -s ${STDERR_PATH} ]];
|
if [ -s ${STDERR_PATH} ];
|
||||||
then
|
then
|
||||||
echo "Test errors:"
|
echo "Test errors:"
|
||||||
echo "==="
|
echo "==="
|
||||||
|
@ -56,8 +57,6 @@ do
|
||||||
echo "==="
|
echo "==="
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Test status: ${ACTUAL_STATUS}"
|
|
||||||
|
|
||||||
if [ "${ACTUAL_STATUS}" != "${EXPECTED_STATUS}" ];
|
if [ "${ACTUAL_STATUS}" != "${EXPECTED_STATUS}" ];
|
||||||
then
|
then
|
||||||
echo "Exit status does not match! (expected ${EXPECTED_STATUS}, got ${ACTUAL_STATUS})"
|
echo "Exit status does not match! (expected ${EXPECTED_STATUS}, got ${ACTUAL_STATUS})"
|
||||||
|
|
Loading…
Reference in New Issue