diff --git a/scripts/1clickservice.groovy b/scripts/1clickservice.groovy index fa9c367..3ee9ab4 100644 --- a/scripts/1clickservice.groovy +++ b/scripts/1clickservice.groovy @@ -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