forked from jrconlin/moz_push
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (46 loc) · 1.75 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
VIRTUALENV = virtualenv
PYTHON = bin/python
PIP = bin/pip
EZ = bin/easy_install
NOSE = bin/nosetests -s --with-xunit
# Broker configuration
BROKER_VHOST = /
BROKER_ADMIN_USER = admin
BROKER_ADMIN_PASSWORD = admin
.PHONY: all env rabbitmq
#all: clean-env env
env:
$(VIRTUALENV) --no-site-packages --distribute .
$(PYTHON) setup.py install
mkdir -p deps
cd deps && hg clone http://hg.mozilla.org/services/server-core
cd deps/server-core && ../../$(PYTHON) setup.py install
install:
mkdir -p /etc/notifserver/
cp etc/notifserver/* /etc/notifserver/
echo "nginx NOT auto-configured."
echo "Please see etc/nginx/nginx.conf.diff for changes."
clean-env:
rm -rf bin build deps include lib lib64
rabbitmq:
mkdir -p bin
cd bin && \
curl --silent http://www.rabbitmq.com/releases/rabbitmq-server/v2.3.1/rabbitmq-server-generic-unix-2.3.1.tar.gz | tar -zvx
mv bin/rabbitmq_server-2.3.1 bin/rabbitmq-server
ln -s -f $(CURDIR)/etc/rabbitmq/rabbitmq-env bin/rabbitmq-server/sbin/rabbitmq-env
cd bin/rabbitmq-server/sbin && \
./rabbitmq-server -detached && sleep 3s && \
./rabbitmqctl add_user $(BROKER_ADMIN_USER) $(BROKER_ADMIN_PASSWORD) && \
./rabbitmqctl set_admin $(BROKER_ADMIN_USER) && \
./rabbitmqctl set_permissions -p $(BROKER_VHOST) admin ".*" ".*" ".*" && \
./rabbitmqctl clear_admin guest && \
./rabbitmqctl set_permissions -p $(BROKER_VHOST) guest "" "" ".*" && \
./rabbitmqctl stop
cd bin/rabbitmq-server/plugins && \
curl -o "#1.ez" "http://www.rabbitmq.com/releases/plugins/v2.3.1/{mochiweb,webmachine,amqp_client,rabbitmq-mochiweb,rabbitmq-management-agent,rabbitmq-management}-2.3.1.ez"
clean-rabbitmq:
-./bin/rabbitmq-server/sbin/rabbitmqctl -q stop
rm -rf var bin/rabbitmq-server
clean: clean-rabbitmq clean-env
test:
$(NOSE) notifserver/tests