-
Notifications
You must be signed in to change notification settings - Fork 0
/
backend.cfg
65 lines (53 loc) · 1.36 KB
/
backend.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
[buildout]
extends =
base.cfg
# relative-paths = true
backend_develop =
backend
lib
boss_client
develop = ${:backend_develop}
backend_parts =
boss_backend
i18n-compile
generate-version
parts = ${:backend_parts}
[boss_backend]
recipe = zc.recipe.egg:scripts
eggs =
boss_backend
pytest
pytest-cov
coverage
sphinx
initialization =
if "backend" in __file__: from view import admin_api_handler, cabinet_api_handler, all_api_handler
interpreter = pyb
entry-points =
ipyb=IPython:start_ipython
[i18n-compile]
recipe = collective.recipe.cmd
on_install = true
on_update = true
cmds = ${buildout:bin-directory}/i18n compile
[versions]
babel=>2.0.2
logbook=0.9.1
pyparsing=2.0.3
[generate-version]
recipe = collective.recipe.cmd:py
on_install = true
on_update = true
cmds =
>>> import os, sys
>>> import datetime
>>> build_date = datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
>>> build_number = os.environ.get("BUILD_NUMBER")
>>> if not build_number:
... try:
... with open(os.path.join(buildout["buildout"]["directory"], "BUILD_NUMBER")) as f:
... build_number = f.read().rstrip()
... except IOError:
... build_number = 1
>>> with open(os.path.join(buildout["buildout"]["directory"], "build"), 'w') as f:
... f.write('version: {"date": "%s", "build": %s}\n' % (build_date, build_number))