diff --git a/client/Makefile b/client/Makefile index 3cc058534b..194420e367 100644 --- a/client/Makefile +++ b/client/Makefile @@ -1,6 +1,6 @@ build: setup-venv - venv/bin/pip install docopt==0.6.2 python-dateutil==2.2 requests==2.4.3 pyinstaller==2.1 termcolor==1.1.0 + venv/bin/pip install docopt==0.6.2 python-dateutil==2.2 PyYAML==3.11 requests==2.4.3 pyinstaller==2.1 termcolor==1.1.0 venv/bin/pyinstaller deis.spec chmod +x dist/deis diff --git a/client/README.rst b/client/README.rst index 32f82c656f..59f31945b0 100644 --- a/client/README.rst +++ b/client/README.rst @@ -75,7 +75,7 @@ you used to provision the server. You can make a symlink or shell alias for .. code-block:: console - $ pip install docopt==0.6.2 python-dateutil==2.2 requests==2.4.3 termcolor==1.1.0 + $ pip install docopt==0.6.2 python-dateutil==2.2 PyYAML==3.11 requests==2.4.3 termcolor==1.1.0 $ sudo ln -fs $(pwd)/client/deis.py /usr/local/bin/deis $ deis Usage: deis [...] diff --git a/client/deis.py b/client/deis.py index fbf9ea66db..f995f68743 100755 --- a/client/deis.py +++ b/client/deis.py @@ -59,6 +59,7 @@ import time import urlparse import webbrowser +import yaml from dateutil import parser from dateutil import relativedelta @@ -867,7 +868,8 @@ def builds(self, args): def builds_create(self, args): """ Creates a new build of an application. Imports an and deploys it to Deis - as a new release. + as a new release. If a Procfile is present in the current directory, it will be used + as the default process types for this application. Usage: deis builds:create [options] @@ -879,11 +881,28 @@ def builds_create(self, args): Options: -a --app= The uniquely identifiable name for the application. + -p --procfile= + A string parse-able by PYYaml to supply a Procfile to the application. """ app = args.get('--app') if not app: app = self._session.app body = {'image': args['']} + procfile = args.get('--procfile') + if procfile: + try: + body['procfile'] = yaml.load(procfile) + except yaml.YAMLError: + self._logger.error('could not parse --procfile') + sys.exit(1) + else: + # read in Procfile for default process types + if os.path.exists('Procfile'): + try: + body['procfile'] = yaml.load(open('Procfile')) + except yaml.YAMLError: + self._logger.error('could not parse Procfile') + sys.exit(1) sys.stdout.write('Creating build... ') sys.stdout.flush() try: diff --git a/client/setup.py b/client/setup.py index 06df3fdc66..39493fdcb3 100755 --- a/client/setup.py +++ b/client/setup.py @@ -57,7 +57,9 @@ ], long_description=LONG_DESCRIPTION, install_requires=[ - 'docopt==0.6.2', 'python-dateutil==2.2', 'requests==2.4.3', 'termcolor==1.1.0' + 'docopt==0.6.2', 'python-dateutil==2.2', + 'PyYAML==3.11', 'requests==2.4.3', + 'termcolor==1.1.0' ], zip_safe=True, **KWARGS) diff --git a/docs/docs_requirements.txt b/docs/docs_requirements.txt index 67b9e5c10c..99dbfd6aa4 100644 --- a/docs/docs_requirements.txt +++ b/docs/docs_requirements.txt @@ -19,11 +19,13 @@ gunicorn==19.1.1 paramiko==1.14.1 psycopg2==2.5.4 python-etcd==0.3.2 +PyYAML==3.11 South==1.0.1 # Deis client requirements docopt==0.6.2 python-dateutil==2.2 +PyYAML==3.11 requests==2.4.3 termcolor==1.1.0 diff --git a/tests/bin/build-deis-cli.sh b/tests/bin/build-deis-cli.sh index 183405ffb3..09ed28270f 100755 --- a/tests/bin/build-deis-cli.sh +++ b/tests/bin/build-deis-cli.sh @@ -4,5 +4,5 @@ virtualenv --system-site-packages venv . venv/bin/activate -pip install docopt==0.6.2 python-dateutil==2.2 requests==2.4.3 pyinstaller==2.1 termcolor==1.1.0 +pip install docopt==0.6.2 python-dateutil==2.2 PyYAML==3.11 requests==2.4.3 pyinstaller==2.1 termcolor==1.1.0 make -C client/ client