-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathMakefile
106 lines (77 loc) · 2.09 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
99
100
101
102
103
104
105
106
ARGS = $(filter-out $@,$(MAKECMDGOALS))
MAKEFLAGS += --silent
#############################
# ENVIRONMENT
#############################
export PROJECT_NAME=bedrock
export DB_PREFIX=wp_
export COMPOSE_PROJECT_NAME=${PROJECT_NAME}
#############################
# INITIALIZATION
#############################
init:
bash ./.utils/init.sh
#############################
# CONTAINER ACCESS
#############################
up:
bash ./.utils/header.sh
echo ""
[ -d "app" ] || make init
bash ./.utils/message.sh info "Starting your project..."
make check-proxy
docker-compose up -d
make urls
stop:
bash ./.utils/message.sh info "Stopping your project..."
docker-compose stop
destroy: stop
bash ./.utils/message.sh info "Deleting all containers..."
docker-compose down --rmi all --remove-orphans
upgrade:
bash ./.utils/message.sh info "Upgrading your project..."
docker-compose pull
docker-compose build --pull
make composer update
make up
restart: stop up
rebuild: destroy upgrade
#############################
# UTILS
#############################
mysql-backup:
bash ./.utils/mysql-backup.sh
mysql-restore:
bash ./.utils/mysql-restore.sh
composer:
mkdir -p app
sleep 1
bash ./.utils/composer.sh $(ARGS)
ci-test:
bash ./.utils/ci/test.sh
#############################
# CONTAINER ACCESS
#############################
ssh:
docker exec -it $$(docker-compose ps -q $(ARGS)) sh
#############################
# INFORMATION
#############################
urls:
bash ./.utils/message.sh headline "You can access your project at the following URLS:"
bash ./.utils/message.sh link "Backend: http://${PROJECT_NAME}.docker/wp/wp-admin/"
bash ./.utils/message.sh link "Frontend: http://${PROJECT_NAME}.docker/"
bash ./.utils/message.sh link "Mailhog: http://mail.${PROJECT_NAME}.docker/"
bash ./.utils/message.sh link "PHPMyAdmin: http://phpmyadmin.${PROJECT_NAME}.docker/"
echo ""
state:
docker-compose ps
logs:
docker-compose logs -f --tail=50 $(ARGS)
check-proxy:
bash ./.utils/check-proxy.sh
#############################
# Argument fix workaround
#############################
%:
@: