-
-
Notifications
You must be signed in to change notification settings - Fork 524
/
Copy pathMakefile
98 lines (77 loc) · 3.5 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
include ./commons-test.mk
.PHONY: lint-all
lint-all:
$(MAKE) lint
$(MAKE) -C modulegen lint
$(MAKE) -C examples lint-examples
$(MAKE) -C modules lint-modules
.PHONY: test-all
test-all: tools test-tools test-unit
.PHONY: test-examples
test-examples:
@echo "Running example tests..."
$(MAKE) -C examples test
.PHONY: tidy-all
tidy-all:
$(MAKE) tidy
$(MAKE) -C examples tidy-examples
$(MAKE) -C modules tidy-modules
## --------------------------------------
TCENV=tcvenv
PYTHONBIN=./$(TCENV)/bin
tcvenv: tcvenv/touchfile
tcvenv/touchfile:
@echo "Creating docs $(TCENV)..."
test -d $(TCENV) || python3 -m venv $(TCENV)
@echo "Installing requirements..."
. $(PYTHONBIN)/activate; pip install -Ur requirements.txt
touch $(TCENV)/touchfile
clean-docs:
@echo "Destroying docs $(TCENV)..."
rm -rf $(TCENV)
.PHONY: serve-docs
serve-docs: tcvenv
. $(PYTHONBIN)/activate; $(PYTHONBIN)/mkdocs serve
## --------------------------------------
# Compose tests: Make goals to test the compose module against the latest versions of the compose and compose-go repositories.
#
# The following goals are available:
#
# - compose-clean: Clean the .build directory, and clean the go.mod and go.sum files in the testcontainers-go compose module.
# - compose-clone: Clone the compose and compose-go repositories into the .build directory.
# - compose-replace: Replace the docker/compose/v2 dependency in the testcontainers-go compose module with the local copy.
# - compose-spec-replace: Replace the compose-spec/compose-go/v2 dependency in the testcontainers-go compose module with the local copy.
# - compose-tidy: Run "go mod tidy" in the testcontainers-go compose module.
# - compose-test-all-latest: Test the testcontainers-go compose module against the latest versions of the compose and compose-go repositories.
# - compose-test-latest: Test the testcontainers-go compose module against the latest version of the compose repository, using current version of the compose-spec repository.
# - compose-test-spec-latest: Test the testcontainers-go compose module against the latest version of the compose-spec repository, using current version of the compose repository.
.PHONY: compose-clean
compose-clean:
rm -rf .build
cd modules/compose && git checkout -- go.mod go.sum
.PHONY: compose-clone
compose-clone: compose-clean
mkdir .build
git clone https://github.com/compose-spec/compose-go.git .build/compose-go & \
git clone https://github.com/docker/compose.git .build/compose
wait
.PHONY: compose-replace
compose-replace:
cd modules/compose && echo "replace github.com/docker/compose/v2 => ../../.build/compose" >> go.mod
.PHONY: compose-spec-replace
compose-spec-replace:
cd modules/compose && echo "replace github.com/compose-spec/compose-go/v2 => ../../.build/compose-go" >> go.mod
.PHONY: compose-tidy
compose-tidy:
cd modules/compose && go mod tidy
# The following three goals are used in the GitHub Actions workflow to test the compose module against the latest versions of the compose and compose-spec repositories.
# Please update the 'docker-projects-latest' workflow if you are making any changes to these goals.
.PHONY: compose-test-all-latest
compose-test-all-latest: compose-clone compose-replace compose-spec-replace compose-tidy
make -C modules/compose test-compose
.PHONY: compose-test-latest
compose-test-latest: compose-clone compose-replace compose-tidy
make -C modules/compose test-compose
.PHONY: compose-test-spec-latest
compose-test-spec-latest: compose-clone compose-spec-replace compose-tidy
make -C modules/compose test-compose