-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
38 lines (30 loc) · 1.04 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
IMAGE_TAG ?= docker-phpldapadmin
TEST_ADDR ?= phpldapadmin
# All: linux/amd64,linux/arm64,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/mips64le,linux/mips64,linux/arm/v7,linux/arm/v6
PLATFORM ?= linux/amd64
ACTION ?= load
PROGRESS_MODE ?= plain
.PHONY: docker-build docker-test run-test cleanup-test test
all: docker-build docker-test
docker-build:
# https://github.com/docker/buildx#building
docker buildx build \
--build-arg VCS_REF="$(shell git rev-parse HEAD)" \
--build-arg BUILD_DATE="$(shell date -u +"%Y-%m-%dT%H:%M:%SZ")" \
--tag $(IMAGE_TAG) \
--progress $(PROGRESS_MODE) \
--platform $(PLATFORM) \
--pull \
--$(ACTION) \
./docker
docker-test: test
test: run-test cleanup-test
run-test:
TEST_ADDR="${TEST_ADDR}" \
IMAGE_TAG="${IMAGE_TAG}" \
docker compose -f docker-compose-latest.test.yml up --exit-code-from=sut --abort-on-container-exit
cleanup-test:
@echo "Stopping and removing the container"
TEST_ADDR="${TEST_ADDR}" \
IMAGE_TAG="${IMAGE_TAG}" \
docker compose -f docker-compose-latest.test.yml down