From 4413ddfbb48f1eb1e71c8a20c7655f2573e4da6a Mon Sep 17 00:00:00 2001 From: Kameron Kenny - pi501 Date: Fri, 27 Dec 2024 16:42:20 -0500 Subject: [PATCH] try again. --- Jenkinsfile | 85 ++++++++++++++++++++++++++++------------------------- 1 file changed, 45 insertions(+), 40 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7736a19..a771925 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,24 +1,4 @@ pipeline { - def remote = [:] - remote.pi501 = [:] - remote.pi502 = [:] - remote.pi503 = [:] - remote.pi504 = [:] - - remote.pi501.name = "pi501.in.thelinuxpro.net" - remote.pi502.name = "pi502.in.thelinuxpro.net" - remote.pi503.name = "pi503.in.thelinuxpro.net" - remote.pi504.name = "pi504.in.thelinuxpro.net" - - remote.pi501.host = "pi501.in.thelinuxpro.net" - remote.pi502.host = "pi502.in.thelinuxpro.net" - remote.pi503.host = "pi503.in.thelinuxpro.net" - remote.pi504.host = "pi504.in.thelinuxpro.net" - - remote.pi501.allowAnyHosts = true - remote.pi502.allowAnyHosts = true - remote.pi503.allowAnyHosts = true - remote.pi504.allowAnyHosts = true agent { label 'pi501.in.thelinuxpro.net' @@ -37,30 +17,55 @@ pipeline { stage("Push out new nrpe configurations") { steps { - sshagent(credentials: ['jenkins']) { - sshPut remote: remote.pi501, from: 'nrpe', into: '/tmp', override: true - sshCommand remote: remote.pi501, command: 'cd /tmp/nrpe/; chmod +x setup.sh; sudo ./setup.sh' - sshRemove remote: pi501, path: '/tmp/nrpe' - } - sshagent(credentials: ['jenkins']) { - sshPut remote: remote.pi502, from: 'nrpe', into: '/tmp', override: true - sshCommand remote: remote.pi502, command: 'cd /tmp/nrpe/; chmod +x setup.sh; sudo ./setup.sh' - sshRemove remote: pi502, path: '/tmp/nrpe' - } - sshagent(credentials: ['jenkins']) { - sshPut remote: remote.pi503, from: 'nrpe', into: '/tmp', override: true - sshCommand remote: remote.pi503, command: 'cd /tmp/nrpe/; chmod +x setup.sh; sudo ./setup.sh' - sshRemove remote: pi503, path: '/tmp/nrpe' - } - sshagent(credentials: ['jenkins']) { - sshPut remote: remote.pi504, from: 'nrpe', into: '/tmp', override: true - sshCommand remote: remote.pi504, command: 'cd /tmp/nrpe/; chmod +x setup.sh; sudo ./setup.sh' - sshRemove remote: pi504, path: '/tmp/nrpe' + script { + def remote = [:] + remote.pi501 = [:] + remote.pi502 = [:] + remote.pi503 = [:] + remote.pi504 = [:] + + remote.pi501.name = "pi501.in.thelinuxpro.net" + remote.pi502.name = "pi502.in.thelinuxpro.net" + remote.pi503.name = "pi503.in.thelinuxpro.net" + remote.pi504.name = "pi504.in.thelinuxpro.net" + + remote.pi501.host = "pi501.in.thelinuxpro.net" + remote.pi502.host = "pi502.in.thelinuxpro.net" + remote.pi503.host = "pi503.in.thelinuxpro.net" + remote.pi504.host = "pi504.in.thelinuxpro.net" + + remote.pi501.allowAnyHosts = true + remote.pi502.allowAnyHosts = true + remote.pi503.allowAnyHosts = true + remote.pi504.allowAnyHosts = true + + sshagent(credentials: ['jenkins']) { + sshPut remote: remote.pi501, from: 'nrpe', into: '/tmp', override: true + sshCommand remote: remote.pi501, command: 'cd /tmp/nrpe/; chmod +x setup.sh; sudo ./setup.sh' + sshRemove remote: pi501, path: '/tmp/nrpe' + } + + sshagent(credentials: ['jenkins']) { + sshPut remote: remote.pi502, from: 'nrpe', into: '/tmp', override: true + sshCommand remote: remote.pi502, command: 'cd /tmp/nrpe/; chmod +x setup.sh; sudo ./setup.sh' + sshRemove remote: pi502, path: '/tmp/nrpe' + } + + sshagent(credentials: ['jenkins']) { + sshPut remote: remote.pi503, from: 'nrpe', into: '/tmp', override: true + sshCommand remote: remote.pi503, command: 'cd /tmp/nrpe/; chmod +x setup.sh; sudo ./setup.sh' + sshRemove remote: pi503, path: '/tmp/nrpe' + } + + sshagent(credentials: ['jenkins']) { + sshPut remote: remote.pi504, from: 'nrpe', into: '/tmp', override: true + sshCommand remote: remote.pi504, command: 'cd /tmp/nrpe/; chmod +x setup.sh; sudo ./setup.sh' + sshRemove remote: pi504, path: '/tmp/nrpe' + } } } } - stage("Build Containers and push to registry") { steps { script {