Skip to content
This repository was archived by the owner on Sep 12, 2018. It is now read-only.

Commit 6049c54

Browse files
author
Mangled Deutz
committed
Fix #377 && Fix #376
Bugsnag is now an "extra". Metadata are now stored centrally in server/__init__.py and no longer duplicated across the codebase. Docker-DCO-1.1-Signed-off-by: Mangled Deutz <[email protected]> (github: dmp42)
1 parent 7a6dacb commit 6049c54

File tree

6 files changed

+74
-31
lines changed

6 files changed

+74
-31
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ add ./config/boto.cfg /etc/boto.cfg
2525
run pip install /docker-registry/depends/docker-registry-core
2626

2727
# Install registry
28-
run pip install /docker-registry/
28+
run pip install file:///docker-registry#egg=docker-registry[bugsnag]
2929

3030
env DOCKER_REGISTRY_CONFIG /docker-registry/config/config_sample.yml
3131
env SETTINGS_FLAVOR dev

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ When using the `config_sample.yml`, you can pass all options through as environm
158158
*non*-Amazon S3-compliant object store, in one of the boto config files'
159159
`[Credentials]` section, set `boto_host`, `boto_port` as appropriate for the
160160
service you are using.
161-
1. `bugsnag`: The bugsnag API key
161+
1. `bugsnag`: The bugsnag API key (note that if you don't use the official docker container, you need to install the registry with bugsnag enabled: `pip install docker-registry[bugsnag]`)
162162
163163
### Authentication options
164164
@@ -405,6 +405,13 @@ Then install the Registry app:
405405
sudo pip install docker-registry
406406
```
407407
408+
If you need extra requirements, like bugsnag, specify them:
409+
410+
```
411+
sudo pip install docker-registry[bugsnag]
412+
```
413+
414+
408415
(or clone the repository and `pip install .`)
409416
410417
#### On Red Hat-based systems:
@@ -421,7 +428,7 @@ should not require the additional repositories.
421428
Then install the Registry app:
422429
423430
```
424-
sudo python-pip install docker-registry
431+
sudo python-pip install docker-registry[bugsnag]
425432
```
426433
427434
(or clone the repository and `pip install .`)

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ cd $SERVICE_APPROOT
77
. ~/env/bin/activate
88

99
pip install --download-cache=~/.pip-cache ./depends/docker-registry-core || exit 1
10-
pip install --download-cache=~/.pip-cache . || exit 1
10+
pip install --download-cache=~/.pip-cache file://`pwd`#egg=docker-registry[bugsnag] || exit 1
1111

1212
cp -R * ~/
1313

docker_registry/app.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
from . import toolkit
1616
from .lib import config
17+
from .server import __version__
1718

18-
VERSION = '0.7.0'
1919
app = flask.Flask('docker-registry')
2020
cfg = config.load()
2121
loglevel = getattr(logging, cfg.get('loglevel', 'INFO').upper())
@@ -35,12 +35,12 @@ def ping():
3535
@app.route('/')
3636
def root():
3737
return toolkit.response('docker-registry server ({0}) (v{1})'
38-
.format(cfg.flavor, VERSION))
38+
.format(cfg.flavor, __version__))
3939

4040

4141
@app.after_request
4242
def after_request(response):
43-
response.headers['X-Docker-Registry-Version'] = VERSION
43+
response.headers['X-Docker-Registry-Version'] = __version__
4444
response.headers['X-Docker-Registry-Config'] = cfg.flavor
4545
return response
4646

@@ -76,7 +76,7 @@ def init():
7676
project_root=root_path,
7777
release_stage=cfg.flavor,
7878
notify_release_stages=[cfg.flavor],
79-
app_version=VERSION
79+
app_version=__version__
8080
)
8181
bugsnag.flask.handle_exceptions(app)
8282

docker_registry/server/__init__.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# -*- coding: utf-8 -*-
2+
3+
__author__ = 'Docker Registry Contributors'
4+
__copyright__ = 'Copyright 2014 Docker'
5+
__credits__ = []
6+
7+
__license__ = 'Apache 2.0'
8+
__version__ = '0.7.0'
9+
__maintainer__ = __author__
10+
__email__ = '[email protected]'
11+
__status__ = 'Production'
12+
13+
__title__ = 'docker-registry'
14+
__build__ = 0x000000
15+
16+
__url__ = 'https://github.com/dotcloud/docker-registry'
17+
__description__ = 'Registry server for Docker'
18+
__download__ = 'https://github.com/dotcloud/docker-registry/archive/master.zip'

setup.py

Lines changed: 41 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88

99
import sys
1010

11-
requirements_txt = open('./requirements.txt')
11+
# XXX as ugly as this looks, namespaces break terribly otherwise
12+
# import docker_registry.lib as lib
13+
execfile('./docker_registry/server/__init__.py')
14+
1215
requirements_txt = open('./requirements/main.txt')
1316
requirements = [line for line in requirements_txt]
1417

@@ -33,34 +36,49 @@
3336
'docker_registry.storage',
3437
'docker_registry.lib.index']
3538

39+
namespaces = ['docker_registry', 'docker_registry.drivers']
40+
41+
package_data = {'docker_registry': ['../config/*']}
42+
43+
3644
setuptools.setup(
37-
name='docker-registry',
38-
# TODO: Load the version programatically, which is currently available in
39-
# docker_registry.app. This is not possible yet because importing
40-
# causes config files to be loaded
41-
version='0.7.0',
42-
description='Registry server for Docker',
43-
long_description=open('README.md').read(),
44-
namespace_packages=['docker_registry', 'docker_registry.drivers'],
45+
name=__title__, # noqa
46+
version=__version__, # noqa
47+
author=__author__, # noqa
48+
author_email=__email__, # noqa
49+
maintainer=__maintainer__, # noqa
50+
maintainer_email=__email__, # noqa
51+
url=__url__, # noqa
52+
description=__description__, # noqa
53+
download_url=__download__, # noqa
54+
long_description=open('./README.md').read(),
55+
namespace_packages=namespaces,
4556
packages=packages,
46-
license=open('LICENSE').read(),
47-
author='Docker Registry Contributors',
48-
author_email='[email protected]',
49-
url='https://github.com/dotcloud/docker-registry',
50-
install_requires=requirements,
51-
classifiers=(
52-
'License :: OSI Approved :: Apache Software License',
53-
'Programming Language :: Python',
54-
'Programming Language :: Python :: 2',
55-
),
56-
platforms=['Independent'],
57-
package_data={'docker_registry': ['../config/*']},
57+
package_data=package_data,
5858
entry_points={
5959
'console_scripts': [
6060
'docker-registry = docker_registry.run:run_gunicorn'
6161
]
6262
},
63+
64+
classifiers=['Development Status :: 4 - Beta',
65+
'Intended Audience :: Developers',
66+
# 'Programming Language :: Python :: 2.6',
67+
'Programming Language :: Python :: 2.7',
68+
# 'Programming Language :: Python :: 3.2',
69+
# 'Programming Language :: Python :: 3.3',
70+
# 'Programming Language :: Python :: 3.4',
71+
'Programming Language :: Python :: Implementation :: CPython',
72+
'Operating System :: OS Independent',
73+
'Topic :: Utilities',
74+
'License :: OSI Approved :: Apache Software License'],
75+
platforms=['Independent'],
76+
license=open('./LICENSE').read(),
6377
zip_safe=False,
64-
tests_require=open('./tests/requirements.txt').read(),
65-
test_suite='nose.collector'
78+
test_suite='nose.collector',
79+
install_requires=requirements,
80+
tests_require=open('./requirements/test.txt').read(),
81+
extras_require={
82+
'bugsnag': ['bugsnag==2.0.1']
83+
}
6684
)

0 commit comments

Comments
 (0)