summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2016-03-06 20:56:02 +0100
committermakefu <github@syntax-fehler.de>2016-03-06 20:56:02 +0100
commit2fd7d1b1ab10dbd84cf85ebf149a12f3a92d7815 (patch)
tree8e1b4f1acb8a20905df26dcbeb36a6802e5fe1d3 /Makefile
parente8679ae6c0fd33be9c84a671d2ebfae51f5851f0 (diff)
parent198407f70fdeacaae5dac6e4ec305629a5368410 (diff)
Merge remote-tracking branch 'cd/master'
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile11
1 files changed, 10 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 12a60a90b..226c0f297 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,12 @@
stockholm ?= .
+export STOCKHOLM_VERSION ?= $(shell \
+ version=git.$$(git describe --always --dirty); \
+ case $$version in (*-dirty) version=$$version@$$(hostname); esac; \
+ date=$$(date +%y.%m); \
+ printf '%s' "$$date.$$version"; \
+)
+
ifndef nixos-config
$(if $(system),,$(error unbound variable: system))
nixos-config = ./$(LOGNAME)/1systems/$(system).nix
@@ -60,7 +67,8 @@ deploy: ssh ?= ssh
deploy:
$(call execute,populate)
$(ssh) $(target_user)@$(target_host) -p $(target_port) \
- nixos-rebuild switch --show-trace -I $(target_path)
+ env STOCKHOLM_VERSION="$$STOCKHOLM_VERSION" \
+ nixos-rebuild switch --show-trace -I $(target_path)
# usage: make LOGNAME=shared system=wolf eval.config.krebs.build.host.name
eval eval.:;@$(call evaluate,$${expr-eval})
@@ -75,6 +83,7 @@ install:
target_path=/mnt$(target_path) $(call execute,populate)
$(ssh) $(target_user)@$(target_host) -p $(target_port) \
env NIXOS_CONFIG=$(target_path)/nixos-config \
+ STOCKHOLM_VERSION="$$STOCKHOLM_VERSION" \
nixos-install
# usage: make test system=foo [target=bar] [method={eval,build}]