Correction upload des paquets sur Vulcain

This commit is contained in:
wpetit 2019-02-05 12:32:12 +01:00
parent 81bb434d06
commit d7623132e5
2 changed files with 6 additions and 5 deletions

View File

@ -1,6 +1,7 @@
def buildPackageWithCPKG(
String packageProfile = "debian",
String packageArch = "",
String packageBranch = "",
String baseImage = "",
String destDir = "./packages",
Boolean forceRebuild = false,
@ -39,7 +40,7 @@ def buildPackageWithCPKG(
if (publishPackages) {
stage("Publish ${packageEnv} packages (version ${packageVersion}) on Vulcain") {
vulcain.publish(destDir, packageEnv, packageDistrib.replace('-', '/'))
vulcain.publish(destDir, packageEnv, packageBranch)
}
}
}

View File

@ -8,14 +8,14 @@ def publish(
if (!packagesBranch) {
packagesBranch = env.BRANCH_NAME
}
withCredentials([
sshUserPrivateKey(credentialsId: sshCredentialsId, keyFileVariable: 'VULCAIN_SSH_KEY', usernameVariable: 'VULCAIN_SSH_USER')
]) {
echo "Publishing packages to '${packagesEnv}/${packagesBranch}'"
sh """
SSH_ARGS='-i ${VULCAIN_SSH_KEY} -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null'
ssh \$SSH_ARGS ${VULCAIN_SSH_USER}@${vulcainHost} mkdir -p '/home/${VULCAIN_SSH_USER}/packages/${packagesEnv}/${packagesBranch}'
scp \$SSH_ARGS -r ${packagesDir}/*.deb '${VULCAIN_SSH_USER}@${vulcainHost}:/home/${VULCAIN_SSH_USER}/packages/${packagesEnv}/${packagesBranch}/'
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}'
scp -i '${VULCAIN_SSH_KEY}' -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -r ${packagesDir}/*.deb '${VULCAIN_SSH_USER}@${vulcainHost}:/home/${VULCAIN_SSH_USER}/packages/${packagesEnv}/${packagesBranch}/'
"""
}
}