Guest User

Untitled

a guest
Feb 23rd, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. #!/usr/bin/env groovy
  2. updateGitlabCommitStatus state: 'pending'
  3. pipeline {
  4. agent any
  5. options {
  6. // Here add name of your saved gitlab configuration with API key
  7. gitLabConnection('Configured gitlab')
  8. }
  9. stages {
  10. stage('Build') {
  11. steps {
  12. echo 'Building....'
  13. updateGitlabCommitStatus state: 'running'
  14. }
  15. post {
  16. success {
  17. updateGitlabCommitStatus name: 'build', state: 'success'
  18. }
  19. failure {
  20. updateGitlabCommitStatus name: 'build', state: 'failed'
  21. }
  22. }
  23. }
  24. stage('Test') {
  25. steps {
  26. echo 'Testing....'
  27. }
  28. post {
  29. success {
  30. updateGitlabCommitStatus name: 'tests', state: 'success'
  31. }
  32. failure {
  33. updateGitlabCommitStatus name: 'tests', state: 'failed'
  34. }
  35. }
  36. }
  37. }
  38. post {
  39. always {
  40. echo 'Always'
  41. deleteDir() /* clean up our workspace */
  42. }
  43. success {
  44. // Gitlab notification could go also here (if you don't need to distinguish between build and test phase)
  45. // updateGitlabCommitStatus name: 'tests', state: 'success'
  46. }
  47. failure {
  48. // Gitlab notification could go also here (if you don't need to distinguish between build and test phase)
  49. // updateGitlabCommitStatus name: 'tests', state: 'success'
  50. }
  51. }
  52. }
Add Comment
Please, Sign In to add comment