File tree 6 files changed +56
-23
lines changed
local/django/celery/worker
6 files changed +56
-23
lines changed Original file line number Diff line number Diff line change
1
+ [run]
2
+ omit =
3
+ tests/*
4
+ */migrations/*
5
+ manage.py
6
+ tests.py
7
+ factories.py
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # This shell script quickly deploys your project to your
4
+ # DigitalOcean Droplet
5
+
6
+ if [ -z " $DIGITAL_OCEAN_IP_ADDRESS " ]
7
+ then
8
+ echo " DIGITAL_OCEAN_IP_ADDRESS not defined"
9
+ exit 0
10
+ fi
11
+
12
+ # generate TAR file from git
13
+ git archive --format tar --output ./project.tar master
14
+
15
+ echo ' Uploading project...'
16
+ rsync ./project.tar root@$DIGITAL_OCEAN_IP_ADDRESS :/tmp/project.tar
17
+ echo ' Uploaded complete.'
18
+
19
+ echo ' Building image...'
20
+ ssh -o StrictHostKeyChecking=no root@$DIGITAL_OCEAN_IP_ADDRESS << 'ENDSSH '
21
+ mkdir -p /app
22
+ rm -rf /app/* && tar -xf /tmp/project.tar -C /app
23
+ docker compose -f /app/docker-compose.prod.yml build
24
+ supervisorctl restart docker-app
25
+ ENDSSH
26
+ echo ' Build complete.'
Original file line number Diff line number Diff line change @@ -5,4 +5,4 @@ set -o nounset
5
5
6
6
watchfiles \
7
7
--filter python \
8
- ' celery -A django_celery_example worker --loglevel=info -Q high_priority,default' # update
8
+ ' celery -A django_celery_example worker --loglevel=info -Q high_priority,default'
Original file line number Diff line number Diff line change @@ -30,8 +30,8 @@ def divide(x, y):
30
30
# rdb.set_trace()
31
31
32
32
# this is for test purposes
33
- # import time
34
- # time.sleep(10)
33
+ import time
34
+ time .sleep (10 )
35
35
return x / y
36
36
37
37
Original file line number Diff line number Diff line change 20
20
21
21
urlpatterns = [
22
22
path ('admin/' , admin .site .urls ),
23
- path ('member/' , include ('tdd.urls' )), # new
23
+ path ('member/' , include ('tdd.urls' )),
24
24
path ('' , include ('polls.urls' )),
25
25
]
26
26
Original file line number Diff line number Diff line change @@ -92,26 +92,26 @@ services:
92
92
- redis
93
93
- db
94
94
95
- # prometheus:
96
- # image: prom/prometheus
97
- # ports:
98
- # - 9090:9090
99
- # command:
100
- # - --config.file=/etc/prometheus/prometheus.yml
101
- # volumes:
102
- # - ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
103
- # depends_on:
104
- # - cadvisor
95
+ prometheus :
96
+ image : prom/prometheus
97
+ ports :
98
+ - 9090:9090
99
+ command :
100
+ - --config.file=/etc/prometheus/prometheus.yml
101
+ volumes :
102
+ - ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
103
+ depends_on :
104
+ - cadvisor
105
105
106
- # cadvisor:
107
- # image: gcr.io/cadvisor/cadvisor
108
- # container_name: cadvisor
109
- # volumes:
110
- # - /:/rootfs:ro
111
- # - /var/run:/var/run:rw
112
- # - /sys:/sys:ro
113
- # - /var/lib/docker/:/var/lib/docker:ro
114
- # - /var/run/docker.sock:/var/run/docker.sock:ro
106
+ cadvisor :
107
+ image : gcr.io/cadvisor/cadvisor
108
+ container_name : cadvisor
109
+ volumes :
110
+ - /:/rootfs:ro
111
+ - /var/run:/var/run:rw
112
+ - /sys:/sys:ro
113
+ - /var/lib/docker/:/var/lib/docker:ro
114
+ - /var/run/docker.sock:/var/run/docker.sock:ro
115
115
116
116
volumes :
117
117
postgres_data :
You can’t perform that action at this time.
0 commit comments