pipeline updated

This commit is contained in:
Benjamin Bohard 2020-09-02 16:52:06 +02:00
parent d2b965f341
commit 122f86e724
1 changed files with 28 additions and 14 deletions

View File

@ -2,6 +2,7 @@
def buildTag def buildTag
def buildContext def buildContext
def distBranch def distBranch
pipeline { pipeline {
agent { agent {
@ -89,20 +90,33 @@ pipeline {
} }
stage("Checkout ref") { stage("Checkout ref") {
dir(env.projectDir) { dir(env.projectDir) {
sh """ withCredentials([
git checkout ${env.ref} sshUserPrivateKey(credentialsId: 'jenkins-forge-ssh', keyFileVariable: 'FORGE_SSH_KEY')]) {
""" writeFile(
sh """ file : "./sshForJenkins.sh",
git tag -am "paquet" pkg/${buildContext[-1]}/${buildContext[1]}/${buildContext[2]}/numero text: '''
""" #!/bin/sh
sh """ ssh -i "${FORGE_SSH_KEY}" -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null "$@"
git tag -d ${env.ref} '''
git push origin :${env.ref} )
""" sh(script: "chmod +x ./sshForJenkins.sh")
sh """ withEnv(["GIT_SSH=./sshForJenkins.sh"]) {
git push --tag origin sh """
""" git checkout ${env.ref}
return """
sh """
git tag -am "paquet" pkg/${buildContext[-1]}/${buildContext[1]}/${buildContext[2]}/numero
"""
sh """
git tag -d ${env.ref}
git push origin :${env.ref}
"""
sh """
git push --tag origin
"""
return
}
}
} }
} }