Skip to content

Commit 0f6761e

Browse files
author
Matthew Fisher
committed
feat(client): add --no-remote option
If --no-remote is set when running `deis create`, no git remote will be created. Instead, it will just be printed to STDOUT. This is useful for CI systems that don't require a git remote. fixes #720
1 parent 3c8a849 commit 0f6761e

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

client/deis.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -417,11 +417,12 @@ def apps_create(self, args):
417417
If no ID is provided, one will be generated automatically.
418418
If no cluster is provided, a cluster named "dev" will be used.
419419
420-
Usage: deis apps:create [<id> --cluster=<cluster>] [options]
420+
Usage: deis apps:create [<id> --cluster=<cluster> --no-remote] [options]
421421
422422
Options
423423
424424
--cluster=CLUSTER target cluster to host application [default: dev]
425+
--no-remote do not create a 'deis' git remote
425426
"""
426427
try:
427428
self._session.git_root() # check for a git repository
@@ -460,9 +461,12 @@ def apps_create(self, args):
460461
hostname = urlparse.urlparse(self._settings['controller']).netloc.split(':')[0]
461462
git_remote = "ssh://git@{hostname}:2222/{app_id}.git".format(**locals())
462463
try:
463-
subprocess.check_call(
464-
['git', 'remote', 'add', '-f', 'deis', git_remote],
465-
stdout=subprocess.PIPE)
464+
if args.get('--no-remote'):
465+
print('remote available at {}'.format(git_remote))
466+
else:
467+
subprocess.check_call(
468+
['git', 'remote', 'add', '-f', 'deis', git_remote],
469+
stdout=subprocess.PIPE)
466470
except subprocess.CalledProcessError:
467471
sys.exit(1)
468472
print('Git remote deis added')

0 commit comments

Comments
 (0)