forked from brettt89/silverstripe-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (46 loc) · 1.73 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
export LOG_LEVEL := $(findstring s,$(word 1, $(MAKEFLAGS)))
ARG = $(filter-out $@,$(MAKECMDGOALS))
TAG = $(if $(filter %,$(ARG)),$(ARG),7.4-apache-buster)
ifndef FRAMEWORK
FRAMEWORK = 4
endif
.PHONY: all build build-image new-test create-project install-project test-build-image test clean $(ARG)
all:
@echo "Silverstripe Web - Docker image builder"
@echo
@echo "Basic Commands"
@echo " build <version> Build Dockerfiles. Filter PHP using <version>."
@echo
@echo "Test Commands"
@echo " new-test <tag> Start a new test using <tag>, Default: 7.4-apache-buster."
@echo " test <tag> Execute tests, assumes project has been build."
@echo " clean Delete all test data."
@echo
@echo "Advanced Test Commands"
@echo " create-project <tag> Create new Silverstripe Project".
@echo
@echo "Parameters"
@echo " <version> PHP version. Format '<major>.<minor>'. e.g. '7.4'"
@echo " <tag> Tag to build/test. e.g. '5.6-apache-jessie'"
update:
./build/update.sh $(ARG)
build:
./build/build-regex.sh $(ARG)
build-image:
./build/build-image.sh $(TAG)
new-test:
@echo "Running new test"
@echo " Tag: $(TAG)"
@echo " BuildDir: src/$(subst -,/,$(TAG))"
@echo
@$(MAKE) --quiet clean
@FRAMEWORK=$(FRAMEWORK) $(MAKE) --quiet create-project $(TAG)
@$(MAKE) --quiet test $(TAG)
create-project:
TAG=$(TAG) docker-compose run composer config -g platform.php $(firstword $(subst -, ,$(TAG)))
TAG=$(TAG) docker-compose run composer config -g platform.ext-intl 1
TAG=$(TAG) docker-compose run composer create-project silverstripe/installer . ^$(FRAMEWORK)
test:
TAG=$(TAG) BUILD_DIR="src/$(subst -,/,$(TAG))" docker-compose run sut
clean:
docker-compose down --volume