Compare commits
5 Commits
redesign-t
...
nebula
Author | SHA1 | Date | |
---|---|---|---|
5ef2c5bf95 | |||
c90b26695a | |||
218868991f | |||
62558c6327 | |||
ff1b1f148d |
@ -1,4 +1,4 @@
|
|||||||
@Library("cadoles@redesign-tamarin") _
|
@Library("cadoles") _
|
||||||
|
|
||||||
pipeline {
|
pipeline {
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ import groovy.util.XmlSlurper
|
|||||||
import groovy.util.slurpersupport.GPathResult
|
import groovy.util.slurpersupport.GPathResult
|
||||||
import groovy.util.slurpersupport.NodeChild
|
import groovy.util.slurpersupport.NodeChild
|
||||||
import groovy.xml.XmlUtil
|
import groovy.xml.XmlUtil
|
||||||
|
import org.jenkinsci.plugins.workflow.steps.FlowInterruptedException
|
||||||
|
|
||||||
class Client {
|
class Client {
|
||||||
|
|
||||||
@ -149,17 +150,16 @@ def runInNewVM(Map args) {
|
|||||||
initWithCredentials(urlCredentialsId, userCredentialsId) { client ->
|
initWithCredentials(urlCredentialsId, userCredentialsId) { client ->
|
||||||
client.withNewVM(vmTemplate, terminateOnExit) { host ->
|
client.withNewVM(vmTemplate, terminateOnExit) { host ->
|
||||||
|
|
||||||
def sshArgs = "-i ${VM_SSH_KEY} -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
|
def sshArgs = "-i '${VM_SSH_KEY}' -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
|
||||||
|
|
||||||
// On attend que la connexion SSH soit disponible
|
// On attend que la connexion SSH soit disponible
|
||||||
println "En attente de l'accès SSH..."
|
println "En attente de l'accès SSH sur la machine ${host}..."
|
||||||
waitUntil {
|
while(true) {
|
||||||
try {
|
def status = sh script: "nc -zv ${host} 22", returnStatus: true
|
||||||
sh "ssh -q ${sshArgs} -o ConnectTimeout=1 root@${host} exit"
|
if (status == 0) {
|
||||||
return true
|
break;
|
||||||
} catch (e) {
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
sleep(5)
|
||||||
}
|
}
|
||||||
|
|
||||||
// On créait un script temporaire à exécuter sur la machine distante
|
// On créait un script temporaire à exécuter sur la machine distante
|
||||||
|
@ -14,7 +14,7 @@ def publish(
|
|||||||
echo "Publishing packages to '${packagesEnv}/${packagesBranch}'"
|
echo "Publishing packages to '${packagesEnv}/${packagesBranch}'"
|
||||||
sh "ssh -i '${VULCAIN_SSH_KEY}' -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null '${VULCAIN_SSH_USER}@${vulcainHost}' mkdir -p '/home/${VULCAIN_SSH_USER}/packages/${packagesEnv}/${packagesBranch}'"
|
sh "ssh -i '${VULCAIN_SSH_KEY}' -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null '${VULCAIN_SSH_USER}@${vulcainHost}' mkdir -p '/home/${VULCAIN_SSH_USER}/packages/${packagesEnv}/${packagesBranch}'"
|
||||||
packages.each {
|
packages.each {
|
||||||
sh "scp -i '${VULCAIN_SSH_KEY}' -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null '${it}' '${VULCAIN_SSH_USER}@${vulcainHost}:/home/${VULCAIN_SSH_USER}/packages/${packagesEnv}/${packagesBranch}/'"
|
sh "scp -C -i '${VULCAIN_SSH_KEY}' -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null '${it}' '${VULCAIN_SSH_USER}@${vulcainHost}:/home/${VULCAIN_SSH_USER}/packages/${packagesEnv}/${packagesBranch}/'"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user