From e58921e546e68366f2b294a01ab1afa262ab8b95 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 10 Mar 2016 12:32:29 +0100 Subject: Makefile: ifndef HOSTNAME, def it --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 226c0f297..bd4544000 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,10 @@ stockholm ?= . +export HOSTNAME ?= $(shell cat /proc/sys/kernel/hostname) + export STOCKHOLM_VERSION ?= $(shell \ version=git.$$(git describe --always --dirty); \ - case $$version in (*-dirty) version=$$version@$$(hostname); esac; \ + case $$version in (*-dirty) version=$$version@$$HOSTNAME; esac; \ date=$$(date +%y.%m); \ printf '%s' "$$date.$$version"; \ ) -- cgit v1.2.3 From 17be0772c5cfcb57f99299ad541b76dfabf8a62d Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 10 Mar 2016 12:41:24 +0100 Subject: Makefile: define nixos-config using ?= --- Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index bd4544000..7252ca70e 100644 --- a/Makefile +++ b/Makefile @@ -9,10 +9,9 @@ export STOCKHOLM_VERSION ?= $(shell \ printf '%s' "$$date.$$version"; \ ) -ifndef nixos-config $(if $(system),,$(error unbound variable: system)) -nixos-config = ./$(LOGNAME)/1systems/$(system).nix -endif + +nixos-config ?= $(stockholm)/$(LOGNAME)/1systems/$(system).nix # target = [target_user@]target_host[:target_port][/target_path] ifdef target -- cgit v1.2.3 From 8629a9de8bcc98686d10387c02489178183b616d Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 10 Mar 2016 15:23:36 +0100 Subject: infest-cac-centos7: target => system --- krebs/5pkgs/test/infest-cac-centos7/default.nix | 2 +- krebs/5pkgs/test/infest-cac-centos7/notes | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/krebs/5pkgs/test/infest-cac-centos7/default.nix b/krebs/5pkgs/test/infest-cac-centos7/default.nix index 5dbb4ebd5..9b14bf486 100644 --- a/krebs/5pkgs/test/infest-cac-centos7/default.nix +++ b/krebs/5pkgs/test/infest-cac-centos7/default.nix @@ -5,7 +5,7 @@ stdenv.mkDerivation rec { name = "${shortname}-${version}"; shortname = "infest-cac-centos7"; - version = "0.2.6"; + version = "0.2.7"; src = ./notes; diff --git a/krebs/5pkgs/test/infest-cac-centos7/notes b/krebs/5pkgs/test/infest-cac-centos7/notes index fafc11572..ab6bc557c 100755 --- a/krebs/5pkgs/test/infest-cac-centos7/notes +++ b/krebs/5pkgs/test/infest-cac-centos7/notes @@ -16,7 +16,7 @@ krebs_cred=${krebs_cred-./cac.json} retiolum_key=${retiolum_key-./retiolum.rsa_key.priv} # build this host user=${user:-shared} -target=${target_system:-test-centos7} +system=${target_system:-test-centos7} log(){ echo "[$(date +"%Y-%m-%d %T")] $@" 2>&1 @@ -45,8 +45,8 @@ if test ! -r "$retiolum_key";then echo "\$retiolum_key=$retiolum_key must be readable"; exit 1 fi -if test ! -r "${user}/1systems/${target}.nix" ;then - echo "cannot find ${user}/1systems/${target}.nix , not started in stockholm directory?" +if test ! -r "${user}/1systems/${system}.nix" ;then + echo "cannot find ${user}/1systems/${system}.nix , not started in stockholm directory?" exit 1 fi @@ -86,7 +86,7 @@ while true;do id=servername:$name log "got a working machine, id=$id" else - elog "Unable to build a virtual machine, retrying in 15 seconds" + log "Unable to build a virtual machine, retrying in 15 seconds" log "Output of build program: $out" sleep 15 continue @@ -153,7 +153,7 @@ make install \ LOGNAME=${user} \ SSHPASS="$(cac-api getserver $id | jq -r .rootpass)" \ ssh='sshpass -e ssh -S none -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' \ - system=${target} \ + system=${system} \ target=$ip log "finalizing installation" cac-api ssh $id < krebs/4lib/infest/finalize.sh -- cgit v1.2.3