add support for creating a dcos-cli binary on linux + osx (#547)

This commit is contained in:
tamarrow
2016-04-28 14:12:09 -07:00
parent 68d329af37
commit 207f1db04c
7 changed files with 83 additions and 2 deletions

View File

@@ -9,6 +9,12 @@ env:
test: env
bin/test.sh
binary: clean env packages
pyinstaller binary/binary.spec
test-binary: binary
bin/test-binary.sh
doc: env
bin/doc.sh

11
cli/bin/test-binary.sh Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/bash -e
BASEDIR=`dirname $0`/..
cd $BASEDIR
PATH=$(pwd)/dist:$PATH
cp tests/data/dcos.toml $DCOS_CONFIG
source env/bin/activate
py.test tests/integrations
deactivate

View File

@@ -0,0 +1,26 @@
# This image runs the dcos-cli test suite.
FROM ubuntu:15.04
MAINTAINER support@mesosphere.com
RUN apt-get update && apt-get install -y \
httpie \
jq \
make \
openssh-client \
git \
sudo \
&& sudo apt-get update --fix-missing \
&& sudo apt-get install -y python-dev build-essential \
&& sudo apt-get install -y python-pip python-virtualenv \
&& pip install pip --upgrade \
&& pip install pyinstaller
ADD . /dcos-cli
WORKDIR /dcos-cli
RUN make clean env packages
WORKDIR /dcos-cli/cli
RUN make clean env packages
RUN make binary && PATH=/dcos-cli/cli/dist:$PATH

35
cli/binary/binary.spec Normal file
View File

@@ -0,0 +1,35 @@
# -*- mode: python -*-
block_cipher = None
a = Analysis(['../dcoscli/main.py'],
pathex=[os.path.dirname(os.getcwd()),
os.getcwd(),
'env/lib/python2.7/site-packages',
'../env/lib/python2.7/site-packages',
],
binaries=None,
datas=[('../dcoscli/data/help/*', 'dcoscli/data/help'),
('../../dcos/data/config-schema/*', 'dcos/data/config-schema'),
('../dcoscli/data/config-schema/*', 'dcoscli/data/config-schema')
],
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
name='dcos',
debug=False,
strip=False,
upx=True,
console=True )

View File

@@ -129,3 +129,6 @@ def set_ssl_info_env_vars(config):
os.environ[constants.DCOS_SSL_VERIFY_ENV] = str(
config['core.ssl_verify'])
if __name__ == "__main__":
main()

View File

@@ -1,4 +1,5 @@
sphinx>=1.3.1, <2.0
tox>=2.2, <3.0
wheel>=0.24.0, <1.0
pytest>=2.9.1
-e .. # Install the DCOS package

View File

@@ -71,8 +71,7 @@ setup(
'toml>=0.9, <1.0',
'virtualenv>=13.0, <14.0',
'rollbar>=0.9, <1.0',
'futures>=3.0, <4.0',
'oauth2client>=1.4, <2.0',
'futures>=3.0, <4.0'
],
# If there are data files included in your packages that need to be