-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
73 lines (56 loc) · 2.05 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
#############################################################################
#
# This is an easily customizable makefile template. The purpose is to
# provide an instant building environment for docker.
#
# Usage:
# ------
# $ make start - run docker containers
# $ make restart - restart docker containers
# $ make stop - stop docker containers
# $ make cwr - run crawler
# $ make tests - run tests
# $ composer-install - composer install
# $ composer-update - composer update
#
#===========================================================================
## Variables
##==========================================================================
BASH_DOCKER_COMPOSE_RUN_WITHOUT_TTL = docker-compose exec -T php-cli /bin/bash
COMMAND_TESTS = /www/vendor/bin/phpunit
## make start
##==========================================================================
start:
make chmod-permissions
docker-compose up -d --build
make chmod-permissions
make composer-install
## make restart
##==========================================================================
restart:
make stop
make start
## make stop
##==========================================================================
stop:
docker-compose down
## make cwr
##==========================================================================
cwr:
$(BASH_DOCKER_COMPOSE_RUN_WITHOUT_TTL) -c "php ./cwr $(ARGS)"
## make tests
##==========================================================================
tests:
$(BASH_DOCKER_COMPOSE_RUN_WITHOUT_TTL) -c "$(COMMAND_TESTS)"
## make composer-install
##==========================================================================
composer-install:
$(BASH_DOCKER_COMPOSE_RUN_WITHOUT_TTL) -c "composer install"
## make composer-update
##==========================================================================
composer-update:
$(BASH_DOCKER_COMPOSE_RUN_WITHOUT_TTL) -c "composer update"
## make chmod-permissions
##==========================================================================
chmod-permissions:
sudo chmod -R 777 www/reports