-
Notifications
You must be signed in to change notification settings - Fork 519
/
Makefile
40 lines (32 loc) · 1.11 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
#/bin/bash
TARGET?=81
.PHONY: tests
tests:
make vichuploader-image
docker run dustin10/vichuploader_php${TARGET} -d date.timezone='UTC' vendor/bin/phpunit
# Makes it easy to run a single test file. Example to run IndexTest.php: make test TEST="IndexTest.php"
.PHONY: test
test:
make vichuploader-image
docker run dustin10/vichuploader_php${TARGET} -d date.timezone='UTC' vendor/bin/phpunit -c ./ ${TEST}
# Stops and removes all containers and removes all images
.PHONY: destroy-environment
destroy-environment:
make remove-containers
-docker rmi $(shell docker images -q)
.PHONY: remove-containers
remove-containers:
-docker stop $(shell docker ps -a -q)
-docker rm -v $(shell docker ps -a -q)
## DOCKER IMAGES
.PHONY: vichuploader-image
vichuploader-image:
docker build -t dustin10/vichuploader_php${TARGET} -f ./docker/Dockerfile${TARGET} .
# Builds all image locally. This can be used to use local images if changes are made locally to the Dockerfiles
.PHONY: build-images
build-images:
make vichuploader-image
# Removes all local images
.PHONY: clean-images
clean-images:
docker rmi dustin10/vichuploader_php${TARGET}