-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
76 lines (56 loc) · 2.27 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
SHELL="/bin/bash"
build:
@docker-compose down
# Make sure we have the website proxy repository.
@if [ ! -d "../ths-website-rproxy" ]; then \
git clone [email protected]:TokyoHackerspace/ths-website-rproxy.git ../ths-website-rproxy; \
fi
# Make sure we have the apache php repository.
@if [ ! -d "../ths-website-apache-php" ]; then \
git clone [email protected]:TokyoHackerspace/ths-website-apache-php.git ../ths-website-apache-php; \
fi
# Check if the main website code exists otherwise pull it locally.
@if [ ! -d "vol/www/main" ]; then \
git clone [email protected]:TokyoHackerspace/ths-website.git vol/www/main; \
mkdir -p vol/www/main/app/events/cache; \
chmod 777 vol/www/main/app/events/cache; \
echo 'closed' > vol/www/main/app/events/cache/status.txt; \
fi
# Check if the akihabara tour website code exists otherwise pull it locally.
@if [ ! -d "vol/www/akihabara/html" ]; then \
git clone [email protected]:TokyoHackerspace/ths-akihabara-tour.git vol/www/akihabara/html; \
fi
# Build everything in the docker-compose.yml file.
@docker-compose build
# Debug throws the docker logs to the console
debug:
@if [ -f "vol/www/main/html/.htaccess" ]; then \
echo "Removing existing symlink to htaccess file"; \
rm vol/www/main/html/.htaccess; \
fi
@echo "Linking development htaccess file";
@(cd vol/www/main/html; ln -s ../app/security/htaccess-dev .htaccess)
@docker-compose down
@docker-compose -f docker-compose.yml -f ./overrides/development.yml up
# Run does not throw the docker logs to the console
production:
@if [ -f "vol/www/main/html/.htaccess" ]; then \
echo "Removing existing symlink to htaccess file"; \
rm vol/www/main/html/.htaccess; \
fi
@echo "Linking production htaccess file";
@(cd vol/www/main/html; ln -s ../app/security/htaccess-prod .htaccess)
@docker-compose down
@docker-compose -f docker-compose.yml -f ./overrides/production.yml up
# Stop brings down docker containers.
stop:
@docker-compose down
# Clean brings down the docker containers and deletes other sub repositories
clean:
@docker-compose down
@echo "Removing the main website repository"
@rm -rf vol/www/main
@echo "Removing the akihabaratour website repository"
@rm -rf vol/www/akihabara
@echo "Removing the mysql temp directory"
@rm -rf vol/mysql