forked from openprocurement/openprocurement.buildout
-
Notifications
You must be signed in to change notification settings - Fork 0
/
base.cfg
219 lines (196 loc) · 6.92 KB
/
base.cfg
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
[buildout]
extensions = mr.developer
package-name =
openprocurement.api
openprocurement.chronograph
openprocurement.concord
openprocurement.planning.api
openprocurement.tender.limited
openprocurement.tender.openua
openprocurement.tender.openeu
openprocurement.contracting.api
openprocurement.tender.openuadefense
openprocurement.tender.competitivedialogue
auto-checkout = ${:package-name}
parts =
scripts
couchpy
circus
circusd
circusctl
circus.ini
couchdb.ini
openprocurement.api.ini
chronograph.ini
openprocurement.concord
contracting_data_bridge
contracting_data_bridge.yaml
competitive_dialogue_data_bridge
competitive_dialogue_data_bridge.yaml
shredder
eggs =
chaussette
request_id_middleware
server_cookie_middleware
${:package-name}
find-links =
http://op:[email protected]/op/
[remotes]
gh = https://github.com/
gh_push = [email protected]:
opgh = ${remotes:gh}openprocurement/openprocurement
opgh_push = ${remotes:gh_push}openprocurement/openprocurement
[sources]
openprocurement.api = git ${remotes:opgh}.api.git pushurl=${remotes:opgh_push}.api.git
openprocurement.chronograph = git ${remotes:opgh}.chronograph.git pushurl=${remotes:opgh_push}.chronograph.git
openprocurement.concord = git ${remotes:opgh}.concord.git pushurl=${remotes:opgh_push}.concord.git
openprocurement.planning.api = git ${remotes:opgh}.planning.api.git pushurl=${remotes:opgh_push}.planning.api.git
openprocurement.tender.limited = git ${remotes:opgh}.tender.limited.git pushurl=${remotes:opgh_push}.tender.limited.git
openprocurement.tender.openua = git ${remotes:opgh}.tender.openua.git pushurl=${remotes:opgh_push}.tender.openua.git
openprocurement.tender.openeu = git ${remotes:opgh}.tender.openeu.git pushurl=${remotes:opgh_push}.tender.openeu.git
openprocurement.contracting.api = git ${remotes:opgh}.contracting.api.git pushurl=${remotes:opgh_push}.contracting.api.git
openprocurement.tender.openuadefense = git ${remotes:opgh}.tender.openuadefense.git pushurl=${remotes:opgh_push}.tender.openuadefense.git
openprocurement.tender.competitivedialogue = git ${remotes:opgh}.tender.competitivedialogue.git pushurl=${remotes:opgh_push}.tender.competitivedialogue.git
[config-from-template]
recipe = collective.recipe.template[genshi]:genshi
input = ${buildout:directory}/templates/${:_buildout_section_name_}
output = ${buildout:directory}/etc/${:_buildout_section_name_}
[scripts]
recipe = zc.recipe.egg
eggs = ${buildout:eggs}
interpreter = python
scripts = chaussette
[contracting_data_bridge]
recipe = zc.recipe.egg
eggs =
openprocurement.contracting.api [databridge]
scripts = contracting_data_bridge
[competitive_dialogue_data_bridge]
recipe = zc.recipe.egg
eggs =
openprocurement.tender.competitivedialogue [databridge]
scripts = competitive_dialogue_data_bridge
[circus]
recipe = zc.recipe.egg
eggs =
circus
circus-web
interpreter =
scripts =
circusd-stats
circus-top
circus-plugin
circushttpd
[couchpy]
<=circus
eggs = CouchDB
scripts =
couchpy
couchdb-replicate
[circusd]
<=circus
initialization =
sys.argv[1:1] = ('${buildout:directory}/etc/circus.ini').split()
scripts = circusd
[circusctl]
<=circus
initialization =
sys.argv[1:1] = ('--endpoint ${circus.ini:endpoint}').split()
scripts = circusctl
[circus.ini]
<= config-from-template
couchdb = True
concord = True
penstock =
vaurien =
statsd = True
webapp = True
web_port = 6543
web_host = 0.0.0.0
chronograph = True
chronograph_port = 6544
chronograph_host = 0.0.0.0
contracting_data_bridge = True
competitive_dialogue_data_bridge = True
endpoint = ipc://${buildout:directory}/var/circus_endpoint
pubsub_endpoint = ipc://${buildout:directory}/var/circus_pubsub
timezone = Europe/Kiev
[couchdb.ini]
<= config-from-template
port = 5984
host = 127.0.0.1
[openprocurement.api.ini]
<= config-from-template
couchdb_url = http://${couchdb.ini:host}:${couchdb.ini:port}/
couchdb_db = openprocurement
debug = false
auth_file = ${buildout:directory}/auth.ini
exc_logger = 1
[chronograph.ini]
<= config-from-template
couchdb_db = openprocurement_chronograph
debug = false
api_url = http://${circus.ini:web_host}:${circus.ini:web_port}/api/0.6/
callback_url = http://${circus.ini:chronograph_host}:${circus.ini:chronograph_port}/
jobstore_db = sqlite:///${buildout:directory}/var/jobs.sqlite
exc_logger = 1
[contracting_data_bridge.yaml]
<= config-from-template
tenders_api_server = https://lb.api-sandbox.openprocurement.org
public_tenders_api_server = http://public.api-sandbox.openprocurement.org
buffers_size = 500
jobs_watcher_delay = 15
full_stack_sync_delay = 15
empty_stack_sync_delay = 101
on_error_sleep_delay = 5
tenders_api_version = 0
contracting_api_server = https://lb.api-sandbox.openprocurement.org
contracting_api_version = 0
api_token = contracting_secret
[competitive_dialogue_data_bridge.yaml]
<= config-from-template
tenders_api_server = https://api-sandbox.openprocurement.org
tenders_api_version = 0
api_token = competitive_dialogue_secret
[logrotate.conf]
<= config-from-template
logs_bucket =
logs_dir =
aws_access_key = ${openprocurement.api.ini:aws_access_key}
aws_secret_key = ${openprocurement.api.ini:aws_secret_key}
[logrotate-hourly]
recipe = z3c.recipe.usercrontab
times = @hourly
command = /usr/sbin/logrotate --state ${buildout:directory}/var/logrotate.status ${logrotate.conf:output} >>${buildout:directory}/var/log/logrotate.log 2>&1
[awscli]
recipe = zc.recipe.egg
scripts = aws
[openprocurement.concord]
recipe = zc.recipe.egg
entry-points = concord=openprocurement.concord.daemon:main
arguments = '${openprocurement.api.ini:couchdb_url}', '${openprocurement.api.ini:couchdb_db}', '${buildout:directory}/var/${:_buildout_section_name_}.status', '${buildout:directory}/var/${:_buildout_section_name_}'
[autostart]
recipe = z3c.recipe.usercrontab
times = @reboot
command = ${buildout:directory}/bin/circusd --daemon --pidfile ${buildout:directory}/circus.pid
[shredder]
recipe = collective.recipe.template
inline =
#!${buildout:bin-directory}/python
from couchdb import Server
from couchdb.design import ViewDefinition
from openprocurement.api.models import get_now
from datetime import timedelta
aserver = Server('http://${couchdb.ini:username}:${couchdb.ini:password}@${couchdb.ini:host}:${couchdb.ini:port}/')
adb = aserver['${openprocurement.api.ini:couchdb_db}']
server = Server('${openprocurement.api.ini:couchdb_url}')
db = server['${openprocurement.api.ini:couchdb_db}']
shredder_view = ViewDefinition('shredder', 'tenders', "function(doc){if(doc.doc_type=='Tender' && doc.status=='draft'){emit(doc.dateModified, doc._rev)}}")
ViewDefinition.sync_many(adb, [shredder_view])
date = (get_now() - timedelta(7)).isoformat()
tenders = []
for i in shredder_view(db, endkey=date):
tenders.append({'_id': i.id, '_rev': i.value, '_deleted': True})
print db.update(tenders)
output = ${buildout:bin-directory}/${:_buildout_section_name_}
mode = 755