Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
138 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# -*- mode: python; -*- | ||
|
||
# | ||
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. | ||
# | ||
import os | ||
|
||
Import('CfgmEnv') | ||
env = CfgmEnv.Clone() | ||
|
||
setup_sources = [ | ||
'setup.py', | ||
] | ||
|
||
setup_sources_rules = [] | ||
for file in setup_sources: | ||
setup_sources_rules.append( | ||
env.Install(Dir('.'), "#controller/src/container/mesos-cni/" + file)) | ||
|
||
local_sources = [ | ||
'mesos_cni/__init__.py', | ||
'mesos_cni/mesos_cni.py', | ||
'mesos_cni/tests/__init__.py', | ||
] | ||
|
||
local_sources_rules = [] | ||
for file in local_sources: | ||
target = "/".join(file.split('/')[:-1]) | ||
local_sources_rules.append( | ||
env.Install(target, "#controller/src/container/mesos-cni/" + file)) | ||
|
||
cd_cmd = 'cd ' + Dir('.').path + ' && ' | ||
sdist_depends = [] | ||
sdist_depends.extend(setup_sources_rules) | ||
sdist_depends.extend(local_sources_rules) | ||
sdist_gen = env.Command('dist/mesos_cni-0.1dev.tar.gz', 'setup.py', | ||
cd_cmd + 'python setup.py sdist') | ||
|
||
env.Depends(sdist_gen, sdist_depends) | ||
env.Default(sdist_gen) | ||
|
||
if 'install' in BUILD_TARGETS: | ||
install_cmd = env.Command(None, 'setup.py', | ||
cd_cmd + 'python setup.py install %s' % | ||
env['PYTHON_INSTALL_OPT']) | ||
env.Depends(install_cmd, sdist_depends) | ||
env.Alias('install', install_cmd) | ||
|
||
env.Alias('install', env.Install(env['INSTALL_CONF'], | ||
'contrail-mesos-cni.conf')) | ||
|
||
buildspace_link = os.environ.get('CONTRAIL_REPO') | ||
if buildspace_link: | ||
# in CI environment shebang limit exceeds for python | ||
# in easy_install/pip, reach to it via symlink | ||
top_path = buildspace_link + '/' + Dir('.').path | ||
top_dir = Dir(top_path) | ||
else: | ||
top_dir = Dir('.') |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# | ||
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. | ||
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# | ||
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. | ||
# | ||
|
||
""" | ||
Mesos CNI plugin | ||
""" | ||
|
||
def main(): | ||
pass | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# | ||
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. | ||
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# | ||
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. | ||
# | ||
|
||
import setuptools, re | ||
import os | ||
|
||
class RunTestsCommand(setuptools.Command): | ||
description = "Test command to run testr in virtualenv" | ||
user_options = [ | ||
('coverage', 'c', | ||
"Generate code coverage report"), | ||
] | ||
boolean_options = ['coverage'] | ||
def initialize_options(self): | ||
self.cwd = None | ||
self.coverage = False | ||
def finalize_options(self): | ||
self.cwd = os.getcwd() | ||
def run(self): | ||
logfname = 'test.log' | ||
args = '-V' | ||
if self.coverage: | ||
logfname = 'coveragetest.log' | ||
args += ' -c' | ||
rc_sig = os.system('./run_tests.sh %s' % args) | ||
if rc_sig >> 8: | ||
os._exit(rc_sig>>8) | ||
with open(logfname) as f: | ||
if not re.search('\nOK', ''.join(f.readlines())): | ||
os._exit(1) | ||
|
||
setuptools.setup( | ||
name='mesos_cni', | ||
version='0.1dev', | ||
packages=setuptools.find_packages(), | ||
package_data={'': ['*.html', '*.css', '*.xml', '*.yml']}, | ||
|
||
# metadata | ||
author="OpenContrail", | ||
author_email="dev@lists.opencontrail.org", | ||
license="Apache Software License", | ||
url="http://www.opencontrail.org/", | ||
|
||
long_description="Mesos CNI Plugin", | ||
|
||
test_suite='mesos_cni.tests', | ||
|
||
entry_points = { | ||
# Please update sandesh/common/vns.sandesh on process name change | ||
'console_scripts' : [ | ||
'contrail-mesos-cni = mesos_cni.mesos_cni:main', | ||
], | ||
}, | ||
cmdclass={ | ||
'run_tests': RunTestsCommand, | ||
}, | ||
) |