@@ -5,7 +5,6 @@ SHELL=/bin/bash
5
5
STATIC_ANALYSIS_CHECKER := $(shell which shellcheck 2> /dev/null)
6
6
LINTER_CHECKER := $(shell which ec 2> /dev/null)
7
7
GIT_DIR = $(shell git rev-parse --git-dir 2> /dev/null)
8
- BASHUNIT_ALPINE_TEST_VERSION_DEFAULT: =3.20
9
8
10
9
OS: =
11
10
ifeq ($(OS ) ,Windows_NT)
36
35
endif
37
36
endif
38
37
39
- ifeq ($(BASHUNIT_ALPINE_TEST_VERSION ) ,)
40
- BASHUNIT_ALPINE_TEST_VERSION:=$(BASHUNIT_ALPINE_TEST_VERSION_DEFAULT)
41
- endif
42
-
43
38
help :
44
39
@echo " "
45
40
@echo " Usage: make [command]"
48
43
@echo " test Run the tests"
49
44
@echo " test/list List all tests under the tests directory"
50
45
@echo " test/watch Automatically run tests every second"
46
+ @echo " test/alpine Run the tests in a Linux/Alpine:latest image"
51
47
@echo " env/example Copy variables without the values from .env into .env.example"
52
48
@echo " pre_commit/install Install the pre-commit hook"
53
49
@echo " pre_commit/run Function that will be called when the pre-commit hook runs"
@@ -72,15 +68,11 @@ test/watch: $(TEST_SCRIPTS)
72
68
@./bashunit $(TEST_SCRIPTS )
73
69
@fswatch -m poll_monitor -or $(SRC_SCRIPTS_DIR ) $(TEST_SCRIPTS_DIR ) .env Makefile | xargs -n1 ./bashunit $(TEST_SCRIPTS )
74
70
75
- test-alpine :
76
- @# Run tests for Alpine in a container with only the very basic dependencies. Bashunit should work for the base
77
- @# Alpine installation.
78
- docker run -v $$(pwd ) :/working --rm alpine:${BASHUNIT_ALPINE_TEST_VERSION} /bin/sh -c " \
79
- apk update && \
80
- apk add bash make shellcheck git curl perl && \
81
- adduser -D builder && \
82
- chown -R builder /working && \
83
- su - builder -c ' cd /working; make test' ; "
71
+ test/alpine :
72
+ @# Run tests for Alpine in a container with only the very basic dependencies
73
+ @docker run --rm -it -v " $( shell pwd) " :/project -w /project alpine:latest \
74
+ sh -c " apk add --no-cache bash make shellcheck git curl perl && \
75
+ bash ./bashunit tests"
84
76
85
77
env/example :
86
78
@echo " Copying variables without the values from .env into .env.example"
0 commit comments