diff options
author | tv <tv@krebsco.de> | 2017-07-12 23:22:15 +0200 |
---|---|---|
committer | tv <tv@krebsco.de> | 2017-07-12 23:22:15 +0200 |
commit | 9e260279d9bbef2ad82d0562be260013962d1556 (patch) | |
tree | c32265290470b1a36ec187cdba0d782c3162db4f /Makefile | |
parent | 7c4fd2a524c68c68a2d5528a83db1fc3a483e2ae (diff) |
Makefile: reimplement {deploy,test} using shell
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 37 |
1 files changed, 6 insertions, 31 deletions
@@ -83,19 +83,14 @@ ifeq ($(MAKECMDGOALS),) $(error No goals specified) endif -# usage: make deploy system=foo [target_host=bar] -ifeq ($(debug),true) -deploy: rebuild-command = dry-activate +# usage: make deploy system=foo [target=bar] +# usage: make test system=foo target=bar +deploy test: +ifdef target + nix-shell --run '$@ --system=$(system) --target=$(target)' else -deploy: rebuild-command = switch + nix-shell --run '$@ --system=$(system)' endif -deploy: ssh ?= ssh -deploy: - $(MAKE) populate debug=false - $(ssh) $(target_user)@$(target_host) -p $(target_port) \ - env STOCKHOLM_VERSION="$$STOCKHOLM_VERSION" \ - nixos-rebuild -Q $(rebuild-command) --show-trace -I $(target_path) \ - |& $(call whatsupnix,$(target_user)@$(target_host):$(target_port)) # usage: make populate system=foo populate: populate-target = \ @@ -129,23 +124,3 @@ install: env NIXOS_CONFIG=$(target_path)/nixos-config \ STOCKHOLM_VERSION="$$STOCKHOLM_VERSION" \ nixos-install - -# usage: make test system=foo [target=bar] [method={eval,build}] -method ?= eval -ifeq ($(method),build) -test: test = $(call build,$(1),$(2)) -else -ifeq ($(method),eval) -test: test ?= $(call evaluate,$(1),$(2)) --json --strict | jq -r . -else -$(error bad method: $(method)) -endif -endif -test: ssh ?= ssh -ifeq ($(target_user)@$(target_host),$(LOGNAME)@$(HOSTNAME)) -test: wrapper = exec -else -test: wrapper = $(ssh) $(target_user)@$(target_host) -p $(target_port) -endif -test: populate - $(wrapper) $(call test,config.system.build.toplevel,-I $(target_path)) |