Utilitaires pour la création de pipeline Jenkins dans l’environnement Cadoles.
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

20 rindas
1007B

  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. }