-
Notifications
You must be signed in to change notification settings - Fork 1
/
trusty-deploy.mk
78 lines (69 loc) · 2.41 KB
/
trusty-deploy.mk
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
# Ubuntu Trusty is the target here.
SELF_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
# Include default values for variables
include $(SELF_DIR)trusty-deploy-defaults.mk
#
# Check if you got root access
#
is_sudo:
echo Make sure i am sudo or fail
#
# nginx
#
std_deploy_nginx: std_install_nginx
echo "std_deploy_nginx is deprecated, please use std_install_nginx instead"
std_install_nginx:
@for F in `find $(NGINX_DIST) -type f -printf "%f\n"`; do \
echo "Copying $$F"; \
cp -- "$(NGINX_DIST)/$$F" "$(NGINX_AVAILABLE)/$(NGINX_PREFIX)$$F"; \
[ -e $(NGINX_ENABLED)/$(NGINX_PREFIX)$$F ] || ln -s $(NGINX_AVAILABLE)/$(NGINX_PREFIX)$$F $(NGINX_ENABLED)/$(NGINX_PREFIX)$$F; \
done;
@for F in `find $(NGINX_DIST) -type f -printf "%f\n"`; do \
echo "Replacing $$F with: $(NGINX_REPLACE_VAR)"; \
$(foreach var,$(NGINX_REPLACE_VAR),sed -i "s/__$(var)__/$(subst /,\/,$($(var)))/g" $(NGINX_AVAILABLE)/$(NGINX_PREFIX)$$F;) \
done;
service nginx reload
std_clean_nginx:
@for F in `find $(NGINX_DIST) -type f -printf "%f\n"`; do \
echo "Removing $$F"; \
rm "$(NGINX_ENABLED)/$(NGINX_PREFIX)$$F"; \
done;
service nginx reload
#
# supervisor
#
std_install_supervisor:
@for F in `find $(SUPERVISOR_DIST) -type f -printf "%f\n"`; do \
echo "Copying $$F"; \
cp -- "$(SUPERVISOR_DIST)/$$F" "$(SUPERVISOR_D)/$(SUPERVISOR_PREFIX)$$F"; \
done;
@for F in `find $(SUPERVISOR_DIST) -type f -printf "%f\n"`; do \
echo "Replacing $$F with: $(SUPERVISOR_REPLACE_VAR)"; \
$(foreach var,$(SUPERVISOR_REPLACE_VAR),sed -i "s/__$(var)__/$(subst /,\/,$($(var)))/g" $(SUPERVISOR_D)/$(SUPERVISOR_PREFIX)$$F;) \
done;
service supervisor force-reload
std_clean_supervisor:
@for F in `find $(SUPERVISOR_DIST) -type f -printf "%f\n"`; do \
echo "Removing $$F"; \
rm "$(SUPERVISOR_D)/$(SUPERVISOR_PREFIX)$$F"; \
done;
service supervisor force-reload
#
# cron
#
std_install_cron:
@for F in `find $(CRON_DIST) -type f -printf "%f\n"`; do \
echo "Copying $$F"; \
cp -- "$(CRON_DIST)/$$F" "$(CRON_D)/$(CRON_PREFIX)$$F"; \
done;
@for F in `find $(CRON_DIST) -type f -printf "%f\n"`; do \
echo "Replacing $$F with: $(CRON_REPLACE_VAR)"; \
$(foreach var,$(CRON_REPLACE_VAR),sed -i "s/__$(var)__/$(subst /,\/,$($(var)))/g" $(CRON_D)/$(CRON_PREFIX)$$F;) \
done;
service cron restart
std_clean_cron:
@for F in `find $(CRON_DIST) -type f -printf "%f\n"`; do \
echo "Removing $$F"; \
rm "$(CRON_D)/$(CRON_PREFIX)$$F"; \
done;
service cron restart