fail-early guards

This commit is contained in:
adam 2024-12-06 23:46:36 -05:00
parent a672887719
commit da1b6aaed8

View File

@ -26,6 +26,27 @@ pipeline {
error("servicename cannot have spaces. try dashes.")
}
sh """#!/bin/bash
function testcmd(){
if ! command -v \$1 2>&1 >/dev/null
then
echo "this agent doesn't have \$1"
exit 1
fi
}
testcmd mktemp
testcmd curl
testcmd git
testcmd sed
testcmd ssh
testcmd ssh-keyscan
testcmd ssh-keygen
testcmd scp
testcmd jq
"""
switch (targetHost) {
case "alloces.lan":
SUDOER_USR = SUDOER_ALLOCES_USR