docs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. @Library('salt@1.1') _
  2. // Define the maximum time, in hours, that a test run should run for
  3. def global_timeout = 2
  4. def salt_target_branch = 'master'
  5. properties([
  6. buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')),
  7. ])
  8. // Be sure to cancel any previously running builds
  9. def buildNumber = env.BUILD_NUMBER as int
  10. if (buildNumber > 1) {
  11. // This will cancel the previous build which also defined a matching milestone
  12. milestone(buildNumber - 1)
  13. }
  14. // Define a milestone for this build so that, if another build starts, this one will be aborted
  15. milestone(buildNumber)
  16. def shell_header
  17. wrappedNode('docs', global_timeout, '#jenkins-prod-pr') {
  18. shell_header = ''
  19. // Checkout the repo
  20. stage('checkout-scm') {
  21. cleanWs notFailBuild: true
  22. checkout scm
  23. }
  24. // Setup the kitchen required bundle
  25. stage('Setup') {
  26. sh shell_header + '''
  27. eval "$(pyenv init -)"
  28. pyenv --version
  29. pyenv install --skip-existing 3.6.8
  30. pyenv shell 3.6.8
  31. python --version
  32. pip install -U nox-py2
  33. nox --version
  34. '''
  35. }
  36. stage('Build HTML Docs') {
  37. sh shell_header + '''
  38. eval "$(pyenv init -)"
  39. pyenv shell 3.6.8
  40. nox -e 'docs-html(compress=True)'
  41. '''
  42. archiveArtifacts artifacts: 'doc/html-archive.tar.gz'
  43. }
  44. stage('Build Man Pages') {
  45. sh shell_header + '''
  46. eval "$(pyenv init -)"
  47. pyenv shell 3.6.8
  48. nox -e 'docs-man(compress=True, update=False)'
  49. '''
  50. archiveArtifacts artifacts: 'doc/man-archive.tar.gz'
  51. }
  52. }
  53. // vim: ft=groovy