add proof of concept ci script

This commit is contained in:
Christian Ulrich 2020-03-26 17:29:06 +01:00
parent 9fd9d1d5d6
commit 1ba7b53003
No known key found for this signature in database
GPG Key ID: 8241BE099775A097
1 changed files with 24 additions and 0 deletions

24
ci/test.sh Executable file
View File

@ -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