Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixops
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: efcca12017ac
Choose a base ref
...
head repository: NixOS/nixops
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f2dc802ab735
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Apr 22, 2019

  1. add nixops copy-closure command

    using `nix copy` instead of the old nix-copy-closure, it's debatable
    though whether we should rely on experimental ui but the new ui is
    stable enough at this point for usage in nixops.
    
    Closes #1118.
    AmineChikhaoui committed Apr 22, 2019
    Copy the full SHA
    6621c53 View commit details

Commits on Apr 23, 2019

  1. Merge pull request #1135 from AmineChikhaoui/feature/nixops-copy-closure

    add nixops copy-closure command
    AmineChikhaoui authored Apr 23, 2019
    Copy the full SHA
    f2dc802 View commit details
Showing with 19 additions and 0 deletions.
  1. +19 −0 scripts/nixops
19 changes: 19 additions & 0 deletions scripts/nixops
Original file line number Diff line number Diff line change
@@ -682,6 +682,20 @@ def op_edit():
os.system("$EDITOR " + " ".join([pipes.quote(x) for x in depl.nix_exprs]))


def op_copy_closure():
depl = open_deployment()
(username, machine) = parse_machine(args.machine)
m = depl.machines.get(machine)
if not m:
raise Exception("unknown machine ‘{0}’".format(machine))
env = dict(os.environ)
env['NIX_SSHOPTS'] = ' '.join(m.get_ssh_flags())
res = subprocess.call(
["nix", "copy", "--to",
"ssh://{}".format(m.get_ssh_name()), args.storepath],
env=env)
sys.exit(res)

# Set up logging of all commands and output
def setup_logging(args):
if os.path.exists('/dev/log') \
@@ -973,6 +987,11 @@ subparser.set_defaults(op=op_import)
subparser = add_subparser('edit', help='open the deployment specification in $EDITOR')
subparser.set_defaults(op=op_edit)

subparser = add_subparser('copy-closure', help='copy closure to a target machine')
subparser.add_argument('machine', help='identifier of the machine')
subparser.add_argument('storepath', help='store path of the closure to be copied')
subparser.set_defaults(op=op_copy_closure)


if os.path.basename(sys.argv[0]) == "charon":
sys.stderr.write(nixops.util.ansi_warn("warning: ‘charon’ is now called ‘nixops’") + "\n")