From 1ba7b53003b103dcc1778ddb9399a63ffb1d1f04 Mon Sep 17 00:00:00 2001 From: Christian Ulrich Date: Thu, 26 Mar 2020 17:29:06 +0100 Subject: [PATCH] add proof of concept ci script --- ci/test.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 ci/test.sh diff --git a/ci/test.sh b/ci/test.sh new file mode 100755 index 0000000..04d95c7 --- /dev/null +++ b/ci/test.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +function call_remote { + local fn="$1" + local args="${@:2}" + + ssh -l christian -p 2200 ulrich.earth "$(declare -f $fn); $fn '$args'" +} + +function worker_has_nix { + which nix-env 2>&1 >/dev/null + has_nix_env=$? + which nix-channel 2>&1 >/dev/null + has_nix_channel=$? + [ "$has_nix_env" -eq 0 ] && [ "$has_nix_channel" -eq 0 ] + echo $? +} + +function test { + $(declare -f worker_has_nix); worker_has_nix +} + +call_remote worker_has_nix +