diff options
author | tv <tv@krebsco.de> | 2016-07-17 02:58:20 +0200 |
---|---|---|
committer | tv <tv@krebsco.de> | 2016-07-17 02:58:20 +0200 |
commit | 9fd601a5648d9652b205b597f626d41fba26ef9f (patch) | |
tree | 032446a83205a642522ac6f0b8f0403a36b28035 | |
parent | bda2d67644eef37af41779cb03b74144b929624b (diff) |
make deploy: admit debug
-rw-r--r-- | Makefile | 20 |
1 files changed, 13 insertions, 7 deletions
@@ -41,17 +41,17 @@ target_path ?= $(_target_path) endif endif -export target_host ?= $(system) -export target_user ?= root -export target_port ?= 22 -export target_path ?= /var/src +target_host ?= $(system) +target_user ?= root +target_port ?= 22 +target_path ?= /var/src $(if $(target_host),,$(error unbound variable: target_host)) $(if $(target_user),,$(error unbound variable: target_user)) $(if $(target_port),,$(error unbound variable: target_port)) $(if $(target_path),,$(error unbound variable: target_path)) -export target ?= $(target_user)@$(target_host):$(target_port)$(target_path) +target ?= $(target_user)@$(target_host):$(target_port)$(target_path) build = \ nix-build \ @@ -75,11 +75,17 @@ $(error No goals specified) endif # usage: make deploy system=foo [target_host=bar] +ifeq ($(debug),true) +deploy: rebuild-command = dry-activate +else +deploy: rebuild-command = switch +endif deploy: ssh ?= ssh -deploy: populate +deploy: + $(MAKE) populate debug=false $(ssh) $(target_user)@$(target_host) -p $(target_port) \ env STOCKHOLM_VERSION="$$STOCKHOLM_VERSION" \ - nixos-rebuild switch --show-trace -I $(target_path) + nixos-rebuild $(rebuild-command) --show-trace -I $(target_path) # usage: make populate system=foo ifeq ($(debug),true) |