Jenkinsfile 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. pipeline {
  2. agent {
  3. label "swarm"
  4. }
  5. environment {
  6. DOCKER_REGISTRY='dev-registry.infoclinica.ru:5000'
  7. DOCKER_IMAGE='ovpn'
  8. SERVICE_IMAGE='container_run'
  9. SERVICE_NAME='ovpn'
  10. SWARM_GIT_URL='ssh://git@git.sdsys.ru:8022/iru/stack-deploy.git'
  11. SWARM_GIT_NAME='stack-deploy'
  12. PKI_GIT_URL='ssh://git@git.sdsys.ru:8022/iru/openvpn-pki.git'
  13. PKI_GIT_NAME='openvpn-pki'
  14. GOST_GIT_DIR='openvpn-gost'
  15. JENKINS_MAIL='jenkins@sdsys.ru'
  16. CLUSTER_NAME='dev-iru-swarm.infoclinica.lan'
  17. }
  18. parameters {
  19. string(
  20. name: "repo",
  21. defaultValue: "prod",
  22. description: "Repository to build and/or deploy from."
  23. )
  24. string(
  25. name: "mailto",
  26. defaultValue: "tomishinets.v@sdsys.ru",
  27. description: "Email which has to be notified."
  28. )
  29. }
  30. stages {
  31. stage("Pull PKI repo") {
  32. steps {
  33. withCredentials([sshUserPrivateKey(credentialsId: 'provision', keyFileVariable: 'GIT_SSH_KEY', passphraseVariable: '', usernameVariable: 'GIT_SSH_USERNAME')]) {
  34. sh '''GIT_SSH_COMMAND='ssh -i ${GIT_SSH_KEY} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' \
  35. git clone ${PKI_GIT_URL}
  36. '''
  37. }
  38. sh '''ls ${WORKSPACE}
  39. '''
  40. }
  41. }
  42. }
  43. post {
  44. always {
  45. deleteDir()
  46. }
  47. }
  48. }