forked from potatosalad/erlang-jose
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
73 lines (61 loc) · 1.85 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
PROJECT = jose
PROJECT_DESCRIPTION = JSON Object Signing and Encryption (JOSE) for Erlang and Elixir.
PROJECT_VERSION = 1.11.3
TEST_DEPS = jiffy jsone jsx libdecaf libsodium ojson proper thoas
dep_jiffy = hex 1.1.1
dep_jsone = hex 1.7.0
dep_jsx = hex 3.1.0
# dep_keccakf1600 = hex 3.0.0
dep_libdecaf = hex 2.1.1
dep_libsodium = hex 2.0.1
dep_ojson = hex 1.0.0
dep_thoas = hex 0.4.0
dep_proper = git https://github.com/proper-testing/proper.git bfd7d862dd5082eeca65c192a7021d0e4de5973e
include erlang.mk
.PHONY: docker-build docker-load docker-setup docker-save docker-shell docker-test docker-test-build
DOCKER_OTP_VERSION ?= 25.0.4-alpine-3.16.1
CT_SUITES ?=
docker-build::
$(gen_verbose) docker build \
--tag ${DOCKER_OTP_VERSION} \
--file test/Dockerfile \
--build-arg OTP_VERSION=${DOCKER_OTP_VERSION} \
test
docker-load::
$(gen_verbose) docker load \
--input "${DOCKER_OTP_VERSION}/image.tar"
docker-save::
$(verbose) mkdir -p "${DOCKER_OTP_VERSION}"
$(gen_verbose) docker save \
--output "${DOCKER_OTP_VERSION}/image.tar" \
${DOCKER_OTP_VERSION}
docker-setup::
$(verbose) if [ -f "${DOCKER_OTP_VERSION}/image.tar" ]; then \
$(MAKE) docker-load; \
else \
$(MAKE) docker-build; \
$(MAKE) docker-save; \
fi
docker-shell::
$(verbose) docker run \
--volume "$(shell pwd)":"/build/jose" --rm --interactive --tty "${DOCKER_OTP_VERSION}" \
/bin/bash -l
ifeq ($(CT_SUITES),)
docker-test::
$(gen_verbose) docker run \
--volume "$(shell pwd)":"/build/jose" \
"${DOCKER_OTP_VERSION}" \
sh -c 'cd jose && make ct'
else
docker-test::
$(gen_verbose) docker run \
--volume "$(shell pwd)":"/build/jose" \
-e CT_SUITES="${CT_SUITES}" \
"${DOCKER_OTP_VERSION}" \
sh -c 'cd jose && make ct'
endif
docker-test-build::
$(gen_verbose) docker run \
--volume "$(shell pwd)":"/build/jose" \
"${DOCKER_OTP_VERSION}" \
sh -c 'cd jose && make test-build'