This repository has been archived by the owner on Jul 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
159 lines (115 loc) · 3.59 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
ARGS = $(filter-out $@,$(MAKECMDGOALS))
MAKEFLAGS += --silent
list:
sh -c "echo; $(MAKE) -p no_targets__ | awk -F':' '/^[a-zA-Z0-9][^\$$#\/\\t=]*:([^=]|$$)/ {split(\$$1,A,/ /);for(i in A)print A[i]}' | grep -v '__\$$' | grep -v 'Makefile'| sort"
#############################
# Setup
#############################
setup: new wait build
#############################
# Docker machine states
#############################
new:
docker-compose pull
docker-compose rm --force app
docker-compose build --no-cache --pull
docker-compose up -d --force-recreate
up:
docker-compose up -d
start:
docker-compose start
stop:
docker-compose stop
down:
docker-compose down --remove-orphans --volumes
state:
docker-compose ps
rebuild:
docker-compose stop
docker-compose pull
docker-compose rm --force app
docker-compose build --no-cache --pull
docker-compose up -d --force-recreate
#############################
# MySQL
#############################
mysql-backup:
bash ./bin/backup.sh mysql
mysql-restore:
bash ./bin/restore.sh mysql
mysql-rm:
docker-compose rm mysql
#############################
# Solr
#############################
solr-backup:
bash ./bin/backup.sh solr
solr-restore:
bash ./bin/restore.sh solr
#############################
# General
#############################
backup: mysql-backup solr-backup
restore: mysql-restore solr-restore
build:
bash bin/build.sh
test:
bash bin/test.sh
clean:
docker-compose down --remove-orphans --volumes
test -d app/vendor & rm -rf app/vendor
test -d app/web & rm -rf app/web
bash: shell
shell:
docker-compose exec --user application app /bin/bash -i
root:
docker-compose exec --user root app /bin/bash -i
wait:
sleep 10
#############################
# Docker
#############################
docker-prune:
docker system prune --all
#############################
# Composer
#############################
composer:
docker-compose exec --user application app composer $(ARGS)
#############################
# TYPO3
#############################
cli:
docker-compose run --rm --user application app cli $(ARGS)
scheduler:
# TODO: remove the workaround "; (exit $?)" when https://github.com/docker/compose/issues/3379 has been fixed
docker-compose exec --user application app /bin/bash -c '"$$WEB_DOCUMENT_ROOT"typo3/cli_dispatch.psh scheduler $(ARGS); (exit $$?)'
#############################
# Apache Solr for TYPO3
#############################
composer-use-dkd-packagist:
docker-compose exec --user application app composer config --global --auth http-basic.repo.packagist.com $(ARGS)
docker-compose exec --user application app composer config repositories.dkd-private-packagist '{"type": "composer", "url": "https://repo.packagist.com/dkd-internet-service/"}'
make composer update mirrors
composer-require-solrfal:
make composer require "apache-solr-for-typo3/solrfal:~5.0.0"
composer-require-solrfluidgrouping:
make composer require "apache-solr-for-typo3/solrfluidgrouping:~1.0.0"
composer-require-solr-source:
test -d app/web/typo3conf/ext/solr & rm -rf app/web/typo3conf/ext/solr
docker-compose exec --user application app composer require --prefer-source "apache-solr-for-typo3/solr:dev-release-8.0.x"
#############################
# CI Testing
#############################
ci-bash:
docker-compose exec --user travis ci /bin/bash -i
ci-solr-bootstrap:
make composer-require-solr-source
docker-compose exec --user travis ci /bin/bash -i /opt/scripts/ci-bootstrap.sh
ci-solr-test:
docker-compose exec --user travis ci /bin/bash -i /opt/scripts/ci-test.sh
#############################
# Argument fix workaround
#############################
%:
@: