summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2016-07-17 02:58:20 +0200
committertv <tv@krebsco.de>2016-07-17 02:58:20 +0200
commit14ccdf48b61e400fd45e180cd0a16e8f99bd0678 (patch)
tree40ba01b47a050ad7449b233aab15fefa9518be58 /Makefile
parent0b84e3f161cee0ac20c6a85f18ad946ce980e0c2 (diff)
make deploy: admit debug
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile20
1 files changed, 13 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index e6a8eeb95..3857a2390 100644
--- a/Makefile
+++ b/Makefile
@@ -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)