Skip to content

Commit efa8c70

Browse files
committedNov 23, 2016
Add deploy --evaluate-only
1 parent 94b5ff9 commit efa8c70

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed
 

‎nixops/deployment.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -854,14 +854,17 @@ def evaluate_active(self, include=[], exclude=[], kill_obsolete=False):
854854
self._destroy_resources(include=to_destroy)
855855

856856

857-
def _deploy(self, dry_run=False, build_only=False, create_only=False, copy_only=False,
857+
def _deploy(self, dry_run=False, build_only=False, create_only=False, copy_only=False, evaluate_only=False,
858858
include=[], exclude=[], check=False, kill_obsolete=False,
859859
allow_reboot=False, allow_recreate=False, force_reboot=False,
860860
max_concurrent_copy=5, sync=True, always_activate=False, repair=False, dry_activate=False):
861861
"""Perform the deployment defined by the deployment specification."""
862862

863863
self.evaluate_active(include, exclude, kill_obsolete)
864864

865+
if evaluate_only:
866+
return
867+
865868
# Assign each resource an index if it doesn't have one.
866869
for r in self.active_resources.itervalues():
867870
if r.index == None:

‎scripts/nixops

+3-1
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,8 @@ def op_deploy():
360360
depl = open_deployment()
361361
if args.confirm:
362362
depl.logger.set_autoresponse("y")
363-
depl.deploy(dry_run=args.dry_run, build_only=args.build_only,
363+
depl.deploy(dry_run=args.dry_run, evaluate_only=args.evaluate_only,
364+
build_only=args.build_only,
364365
create_only=args.create_only, copy_only=args.copy_only,
365366
include=args.include or [], exclude=args.exclude or [],
366367
check=args.check, kill_obsolete=args.kill_obsolete,
@@ -768,6 +769,7 @@ subparser.add_argument('--kill-obsolete', '-k', action='store_true', help='kill
768769
subparser.add_argument('--dry-run', action='store_true', help='show what will be built')
769770
subparser.add_argument('--dry-activate', action='store_true', help='show what will be activated on the machines in the network')
770771
subparser.add_argument('--repair', action='store_true', help='use --repair when calling nix-build (slow)')
772+
subparser.add_argument('--evaluate-only', action='store_true', help='only call nix-instantiate and exit')
771773
subparser.add_argument('--build-only', action='store_true', help='build only; do not perform deployment actions')
772774
subparser.add_argument('--create-only', action='store_true', help='exit after creating missing machines')
773775
subparser.add_argument('--copy-only', action='store_true', help='exit after copying closures')

0 commit comments

Comments
 (0)
Please sign in to comment.