Librairie utilitaire pour Jenkins
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

vulcain.groovy 1007B

1234567891011121314151617181920
  1. def publish(
  2. List packages = [],
  3. String packagesEnv = 'dev',
  4. String packagesBranch = '',
  5. String sshCredentialsId = 'vulcain-packages-ssh-keypair',
  6. String vulcainHost = 'vulcain.cadoles.com'
  7. ) {
  8. if (!packagesBranch) {
  9. packagesBranch = env.BRANCH_NAME
  10. }
  11. withCredentials([
  12. sshUserPrivateKey(credentialsId: sshCredentialsId, keyFileVariable: 'VULCAIN_SSH_KEY', usernameVariable: 'VULCAIN_SSH_USER')
  13. ]) {
  14. echo "Publishing packages to '${packagesEnv}/${packagesBranch}'"
  15. 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}'"
  16. packages.each {
  17. 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}/'"
  18. }
  19. }
  20. }