Jenkinsfile-windows 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. #!groovy
  2. // StarPU --- Runtime system for heterogeneous multicore architectures.
  3. //
  4. // Copyright (C) 2018 CNRS
  5. //
  6. // StarPU is free software; you can redistribute it and/or modify
  7. // it under the terms of the GNU Lesser General Public License as published by
  8. // the Free Software Foundation; either version 2.1 of the License, or (at
  9. // your option) any later version.
  10. //
  11. // StarPU is distributed in the hope that it will be useful, but
  12. // WITHOUT ANY WARRANTY; without even the implied warranty of
  13. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14. //
  15. // See the GNU Lesser General Public License in COPYING.LGPL for more details.
  16. //
  17. def statusHasChanged = false
  18. pipeline
  19. {
  20. agent none
  21. // Trigger the build
  22. triggers
  23. {
  24. // Poll gforge explicitly every hour
  25. pollSCM('00 * * * *')
  26. }
  27. stages
  28. {
  29. stage('Tarball')
  30. {
  31. steps
  32. {
  33. node('autotools')
  34. {
  35. checkout scm
  36. sh 'contrib/ci.inria.fr/job-0-tarball.sh'
  37. script
  38. {
  39. env.tarballgz = sh (script: 'ls *.tar.gz', returnStdout: true).trim()
  40. }
  41. stash includes: "${env.tarballgz}", name: 'tarballgz'
  42. stash includes: "starpu.pdf", name: 'doc'
  43. stash includes: "starpu_dev.pdf", name: 'doc_dev'
  44. // Stash those scripts because they are not in make dist
  45. dir('contrib/ci.inria.fr')
  46. {
  47. stash includes: "job-1-check-windows.bat", name: 'script-windows-check'
  48. stash includes: "job-1-build-windows.sh", name: 'script-windows-build'
  49. }
  50. archiveArtifacts artifacts: "${env.tarballgz},starpu.pdf,starpu_dev.pdf", fingerprint: true, onlyIfSuccessful: true
  51. deleteDir()
  52. }
  53. }
  54. }
  55. stage('Check')
  56. {
  57. steps
  58. {
  59. script
  60. {
  61. labelToSelect = 'windows'
  62. listOfNodeNames = jenkins.model.Jenkins.instance.nodes.collect
  63. {
  64. node -> node.getLabelString().contains(labelToSelect) ? node.name : null
  65. }
  66. listOfNodeNames.removeAll(Collections.singleton(null))
  67. def p = listOfNodeNames.collectEntries
  68. {
  69. [ (it):
  70. {
  71. node(it)
  72. {
  73. dir('check-windows')
  74. {
  75. unstash 'tarballgz'
  76. unstash 'script-windows-check'
  77. unstash 'script-windows-build'
  78. bat './job-1-check-windows.bat'
  79. script
  80. {
  81. env.zip = bat (script: 'dir /b *zip', returnStdout: true).trim()
  82. }
  83. stash includes: "${env.zip}", name: 'zip'
  84. archiveArtifacts artifacts: "${env.zip}", fingerprint: true, onlyIfSuccessful: true
  85. // if (env.KEEP_WORKING_DIRECTORY != 'true')
  86. // deleteDir()
  87. }
  88. }
  89. }
  90. ]}
  91. parallel p;
  92. }
  93. }
  94. }
  95. }
  96. // post
  97. // {
  98. // // hooks are called in order: always, changed, aborted, failure, success, unstable
  99. // changed
  100. // {
  101. // echo "Build status has changed."
  102. // script
  103. // {
  104. //
  105. // statusHasChanged = true
  106. // }
  107. // }
  108. // success
  109. // {
  110. // echo "Build success."
  111. // // email when changed to success
  112. // script
  113. // {
  114. // if (statusHasChanged)
  115. // {
  116. // emailext(body: '${DEFAULT_CONTENT}',
  117. // subject: '${DEFAULT_SUBJECT}',
  118. // replyTo: '$DEFAULT_REPLYTO',
  119. // to: '$DEFAULT_RECIPIENTS',
  120. // recipientProviders: [[$class: 'CulpritsRecipientProvider'],[$class: 'RequesterRecipientProvider']])
  121. // }
  122. // }
  123. // }
  124. // failure
  125. // {
  126. // echo "Build failure."
  127. // // always email on failure
  128. // emailext(body: '${DEFAULT_CONTENT}',
  129. // subject: '${DEFAULT_SUBJECT}',
  130. // replyTo: '$DEFAULT_REPLYTO',
  131. // to: '$DEFAULT_RECIPIENTS',
  132. // recipientProviders: [[$class: 'CulpritsRecipientProvider'],[$class: 'RequesterRecipientProvider']])
  133. // }
  134. // }
  135. }