make deploy: admit debug

This commit is contained in:
tv 2016-07-17 02:58:20 +02:00
parent 0b84e3f161
commit 14ccdf48b6

View File

@ -41,17 +41,17 @@ target_path ?= $(_target_path)
endif endif
endif endif
export target_host ?= $(system) target_host ?= $(system)
export target_user ?= root target_user ?= root
export target_port ?= 22 target_port ?= 22
export target_path ?= /var/src target_path ?= /var/src
$(if $(target_host),,$(error unbound variable: target_host)) $(if $(target_host),,$(error unbound variable: target_host))
$(if $(target_user),,$(error unbound variable: target_user)) $(if $(target_user),,$(error unbound variable: target_user))
$(if $(target_port),,$(error unbound variable: target_port)) $(if $(target_port),,$(error unbound variable: target_port))
$(if $(target_path),,$(error unbound variable: target_path)) $(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 = \ build = \
nix-build \ nix-build \
@ -75,11 +75,17 @@ $(error No goals specified)
endif endif
# usage: make deploy system=foo [target_host=bar] # 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: ssh ?= ssh
deploy: populate deploy:
$(MAKE) populate debug=false
$(ssh) $(target_user)@$(target_host) -p $(target_port) \ $(ssh) $(target_user)@$(target_host) -p $(target_port) \
env STOCKHOLM_VERSION="$$STOCKHOLM_VERSION" \ 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 # usage: make populate system=foo
ifeq ($(debug),true) ifeq ($(debug),true)