-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathnewslynx-core.yaml
99 lines (85 loc) · 2.46 KB
/
newslynx-core.yaml
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
---
- include: postgres.yaml
- include: redis.yaml
- name: install newslynx-core apt requirements.
apt: name={{item}} state=present update_cache=yes
with_items:
- libxml2-dev
- libxslt1-dev
- libffi-dev
- postgresql-plpython-9.3
- python-dev
- python-setuptools
- pandoc
sudo: yes
- name: install pip
command: easy_install pip
sudo: yes
- name: clone newslynx-core to remote server
git: repo=git://github.com/newslynx/newslynx-core.git
dest={{home}}/newslynx-core
accept_hostkey=true
- name: checkout the master branch of newslynx-core
command: "git checkout {{core_branch}}"
args:
chdir: "{{home}}/newslynx-core/"
ignore_errors: yes
- name: pull newslynx-core
command: "git pull origin {{core_branch}}"
args:
chdir: "{{home}}/newslynx-core/"
sudo: yes
- name: ensure the dot newslynx directory exists
file: "state=directory path=~/.newslynx/ mode=0700"
sudo: yes
- name: copy ~/.newslynx/config.yaml template
template:
args:
src: "templates/config.yaml.j2"
dest: "~/.newslynx/config.yaml"
mode: 0700
sudo: yes
- name: ensure the dot newslynx defaults directory exists
file: "state=directory path=~/.newslynx/defaults mode=0700"
sudo: yes
- name: ensure the dot newslynx sous-chefs directory exists
file: "state=directory path=~/.newslynx/sous-chefs mode=0700"
sudo: yes
- name: initialize newslynx with application defaults.
command: make app_install
sudo: yes
args:
chdir: "{{home}}/newslynx-core/"
# SUPERVISOR
- include: supervisor.yaml
vars:
name: api
exec: "/usr/local/bin/gunicorn newslynx.views:app -b 0.0.0.0:{{api_port}} -w {{api_workers}} -k gevent -t {{api_timeout}} --access-logfile {{home}}/logs/access-api.log"
directory: "{{home}}/newslynx-core"
logdir: "{{home}}/logs"
numprocs: 1
user: root
- include: supervisor.yaml
vars:
name: bulk-queue
exec: "/usr/local/bin/rqworker bulk"
directory: "{{home}}/newslynx-core/"
logdir: "{{home}}/logs"
numprocs: "{{bulk_workers}}"
user: root
- include: supervisor.yaml
vars:
name: recipe-queue
exec: "/usr/local/bin/rqworker recipe"
directory: "{{home}}/newslynx-core"
logdir: "{{home}}/logs"
numprocs: "{{recipe_workers}}"
user: root
- include: supervisor.yaml
vars:
name: cron
exec: "/usr/local/bin/newslynx cron --interval={{cron_interval}}"
directory: "{{home}}/newslynx-core"
logdir: "{{home}}/logs"
numprocs: 1
user: root