Jenkinsfile-basic 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #!groovy
  2. pipeline
  3. {
  4. agent none
  5. stages
  6. {
  7. stage('Tarball')
  8. {
  9. steps
  10. {
  11. node('autotools')
  12. {
  13. checkout scm
  14. sh 'contrib/ci.inria.fr/job-0-tarball.sh'
  15. script
  16. {
  17. env.tarballgz = sh (script: 'ls build/*.tar.gz', returnStdout: true).trim()
  18. }
  19. stash includes: "${env.tarballgz}", name: 'tarballgz'
  20. stash includes: "starpu.pdf", name: 'doc'
  21. // Stash those scripts because they are not in make dist
  22. dir('contrib/ci.inria.fr')
  23. {
  24. stash includes: "job-1-check.sh", name: 'script-unix-check'
  25. }
  26. archiveArtifacts artifacts: "${env.tarballgz},starpu.pdf", fingerprint: true, onlyIfSuccessful: true
  27. }
  28. }
  29. }
  30. stage('Check')
  31. {
  32. steps
  33. {
  34. script
  35. {
  36. labelToSelect = 'unix'
  37. listOfNodeNames = jenkins.model.Jenkins.instance.nodes.collect
  38. {
  39. node -> node.getLabelString().contains(labelToSelect) ? node.name : null
  40. }
  41. listOfNodeNames.removeAll(Collections.singleton(null))
  42. def p = listOfNodeNames.collectEntries
  43. {
  44. [ (it):
  45. {
  46. node(it)
  47. {
  48. dir('check-unix')
  49. {
  50. unstash 'tarballgz'
  51. unstash 'script-unix-check'
  52. sh 'chmod 755 job-1-check.sh && ./job-1-check.sh'
  53. deleteDir()
  54. }
  55. }
  56. }
  57. ]}
  58. parallel p;
  59. }
  60. }
  61. }
  62. }
  63. }