jenkinsfile 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #!/usr/bin/env groovy
  2. pipeline {
  3. agent { label 'prod' }
  4. stages {
  5. stage('Check env') {
  6. steps {
  7. echo "Displaying Jenkins environment variables ..."
  8. echo "BRANCH_NAME : ${env.BRANCH_NAME}"
  9. echo "BUILD_NUMBER : ${env.BUILD_NUMBER}"
  10. echo "BUILD_ID : ${env.BUILD_ID}"
  11. echo "BUILD_DISPLAY_NAME : ${env.BUILD_DISPLAY_NAME}"
  12. echo "JOB_NAME : ${env.JOB_NAME}"
  13. echo "JOB_BASE_NAME : ${env.JOB_BASE_NAME}"
  14. echo "BUILD_TAG : ${env.BUILD_TAG}"
  15. echo "EXECUTOR_NUMBER : ${env.EXECUTOR_NUMBER}"
  16. echo "NODE_NAME : ${env.NODE_NAME}"
  17. echo "NODE_LABELS : ${env.NODE_LABELS}"
  18. echo "WORKSPACE : ${env.WORKSPACE}"
  19. echo "JENKINS_HOME : ${env.JENKINS_HOME}"
  20. echo "JENKINS_URL : ${env.JENKINS_URL}"
  21. echo "BUILD_URL : ${env.BUILD_URL}"
  22. echo "JOB_URL : ${env.JOB_URL}"
  23. echo "JOVIAN_WEB_DEPLOY_PATH : ${env.JOVIAN_WEB_DEPLOY_PATH}"
  24. echo "JOVIAN_WEB_PREPROD_PATH : ${env.JOVIAN_WEB_PREPROD_PATH}"
  25. echo "Done."
  26. }
  27. }
  28. stage('Deploy') {
  29. when { branch 'master' }
  30. steps {
  31. sh "rsync --delete --recursive --verbose web/ ${env.JOVIAN_WEB_DEPLOY_PATH}"
  32. }
  33. }
  34. }
  35. }