Jenkinsfile 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. // Autogenerated by build scripts. Do not edit.
  2. pipeline {
  3. agent {
  4. node {
  5. label 'jenkins-agent-web'
  6. customWorkspace '/workspace'
  7. }
  8. }
  9. options {
  10. timestamps()
  11. timeout(time: 15, unit: 'MINUTES')
  12. }
  13. environment {
  14. BRANCH_NAME = "${env.CHANGE_BRANCH ? env.CHANGE_BRANCH : env.BRANCH_NAME}"
  15. JENKINS_BUILD_NUMBER = "${BUILD_NUMBER}"
  16. BUILD_NUMBER = "${SHORT_SHA}_${BUILD_NUMBER}"
  17. DOCKER_COMPOSE_FLAGS = '-f docker-compose.ci.yml'
  18. COMMIT_SHA = "${GIT_COMMIT}"
  19. SHORT_SHA = "${GIT_COMMIT.take(7)}"
  20. }
  21. stages {
  22. stage('Stage 1') {
  23. parallel {
  24. stage('Build') {
  25. steps {
  26. dir('services/clsi') {
  27. retry(count: 3) {
  28. sh 'make build'
  29. }
  30. }
  31. }
  32. }
  33. stage('Pull TL2017') {
  34. steps {
  35. // Remove after new worker VM image is live.
  36. sh 'docker pull us-east1-docker.pkg.dev/overleaf-ops/ol-docker/texlive-full:2017.1'
  37. }
  38. }
  39. stage('Create reports folder') {
  40. steps {
  41. sh 'mkdir services/clsi/reports'
  42. }
  43. }
  44. }
  45. }
  46. stage('Stage 2') {
  47. parallel {
  48. stage('Push Branch Image') {
  49. steps {
  50. dir('services/clsi') {
  51. sh 'make push_branch'
  52. }
  53. }
  54. }
  55. stage('Shellcheck') {
  56. steps {
  57. dir('services/clsi') {
  58. sh 'make shellcheck'
  59. }
  60. }
  61. }
  62. stage('Lint') {
  63. steps {
  64. dir('services/clsi') {
  65. sh 'make lint_ci'
  66. }
  67. }
  68. post {
  69. always {
  70. recordIssues checksAnnotationScope: 'ALL', enabledForFailure: true, failOnError: true, id: 'clsi-eslint', name: 'clsi eslint', qualityGates: [[integerThreshold: 1, threshold: 1.0, type: 'TOTAL']], sourceCodeRetention: 'LAST_BUILD', tools: [esLint(pattern: 'services/clsi/reports/eslint.json')]
  71. }
  72. }
  73. }
  74. stage('Format') {
  75. steps {
  76. dir('services/clsi') {
  77. sh 'make format_ci'
  78. }
  79. }
  80. }
  81. stage('Typecheck') {
  82. steps {
  83. dir('services/clsi') {
  84. sh 'make typecheck_ci'
  85. }
  86. }
  87. }
  88. stage('Test Unit') {
  89. steps {
  90. dir('services/clsi') {
  91. retry(count: 3) {
  92. sh 'make test_unit'
  93. }
  94. }
  95. }
  96. }
  97. stage('Test Acceptance') {
  98. environment {
  99. COMPOSE_PROJECT_NAME_TEST_ACCEPTANCE = "test_acceptance"
  100. }
  101. steps {
  102. dir('services/clsi') {
  103. retry(count: 3) {
  104. sh 'make test_acceptance'
  105. }
  106. }
  107. }
  108. }
  109. }
  110. }
  111. stage('Push Production') {
  112. steps {
  113. dir('services/clsi') {
  114. sh 'make push'
  115. }
  116. }
  117. }
  118. }
  119. post {
  120. always {
  121. junit checksName: 'clsi test results', testResults: 'services/clsi/reports/junit-*.xml'
  122. }
  123. cleanup {
  124. dir('services/clsi') {
  125. sh 'make clean'
  126. }
  127. sh 'make clean_jenkins -j10'
  128. }
  129. }
  130. }