Jenkinsfile 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. pipeline {
  2. agent any
  3. environment {
  4. LANG = "en_US.UTF-8"
  5. LANGUAGE = "en_US.UTF-8"
  6. LC_ALL = "en_US.UTF-8"
  7. PATH = "PATH=$HOME/.rbenv/bin:$HOME/.rbenv/shims:/usr/local/bin/:$PATH"
  8. }
  9. stages {
  10. stage('env setup') {
  11. steps {
  12. script {
  13. // CHANGE_ID is set only for pull requests, so it is safe to access the pullRequest global variable
  14. if (env.CHANGE_ID) {
  15. currentBuild.displayName = "PR #${pullRequest.number}: ${pullRequest.title}"
  16. }
  17. }
  18. sh 'make setup'
  19. }
  20. }
  21. stage('build dependencies') {
  22. steps {
  23. sh 'make dependencies'
  24. }
  25. }
  26. stage('test') {
  27. steps {
  28. ansiColor('xterm') {
  29. sh 'make test'
  30. }
  31. }
  32. }
  33. }
  34. post {
  35. success {
  36. script {
  37. // CHANGE_ID is set only for pull requests, so it is safe to access the pullRequest global variable
  38. if (env.CHANGE_ID) {
  39. def comment = pullRequest.comment("👍 Build PASSED commit: ${pullRequest.head}\nbuild: ${currentBuild.absoluteUrl}")
  40. }
  41. }
  42. }
  43. failure {
  44. script {
  45. // CHANGE_ID is set only for pull requests, so it is safe to access the pullRequest global variable
  46. if (env.CHANGE_ID) {
  47. def comment = pullRequest.comment("💥 Build FAILED commit: ${pullRequest.head}\nbuild: ${currentBuild.absoluteUrl}")
  48. }
  49. }
  50. }
  51. }
  52. }