Jenkinsfile 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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/filestore') {
  27. retry(count: 3) {
  28. sh 'make build'
  29. }
  30. }
  31. }
  32. }
  33. stage('Create reports folder') {
  34. steps {
  35. sh 'mkdir services/filestore/reports'
  36. }
  37. }
  38. }
  39. }
  40. stage('Stage 2') {
  41. parallel {
  42. stage('Push Branch Image') {
  43. steps {
  44. dir('services/filestore') {
  45. sh 'make push_branch'
  46. }
  47. }
  48. }
  49. stage('Shellcheck') {
  50. steps {
  51. dir('services/filestore') {
  52. sh 'make shellcheck'
  53. }
  54. }
  55. }
  56. stage('Lint') {
  57. steps {
  58. dir('services/filestore') {
  59. sh 'make lint_ci'
  60. }
  61. }
  62. post {
  63. always {
  64. recordIssues checksAnnotationScope: 'ALL', enabledForFailure: true, failOnError: true, id: 'filestore-eslint', name: 'filestore eslint', qualityGates: [[integerThreshold: 1, threshold: 1.0, type: 'TOTAL']], sourceCodeRetention: 'LAST_BUILD', tools: [esLint(pattern: 'services/filestore/reports/eslint.json')]
  65. }
  66. }
  67. }
  68. stage('Format') {
  69. steps {
  70. dir('services/filestore') {
  71. sh 'make format_ci'
  72. }
  73. }
  74. }
  75. stage('Typecheck') {
  76. steps {
  77. dir('services/filestore') {
  78. sh 'make typecheck_ci'
  79. }
  80. }
  81. }
  82. stage('Test Unit') {
  83. steps {
  84. dir('services/filestore') {
  85. retry(count: 3) {
  86. sh 'make test_unit'
  87. }
  88. }
  89. }
  90. }
  91. stage('Test Acceptance SHARD_01_') {
  92. environment {
  93. COMPOSE_PROJECT_NAME_TEST_ACCEPTANCE = "test_acceptance_shard_01_x"
  94. MOCHA_GREP = "SHARD_01_"
  95. }
  96. steps {
  97. dir('services/filestore') {
  98. retry(count: 3) {
  99. sh 'make test_acceptance'
  100. }
  101. }
  102. }
  103. }
  104. stage('Test Acceptance SHARD_02_') {
  105. environment {
  106. COMPOSE_PROJECT_NAME_TEST_ACCEPTANCE = "test_acceptance_shard_02_x"
  107. MOCHA_GREP = "SHARD_02_"
  108. }
  109. steps {
  110. dir('services/filestore') {
  111. retry(count: 3) {
  112. sh 'make test_acceptance'
  113. }
  114. }
  115. }
  116. }
  117. stage('Test Acceptance SHARD_03_') {
  118. environment {
  119. COMPOSE_PROJECT_NAME_TEST_ACCEPTANCE = "test_acceptance_shard_03_x"
  120. MOCHA_GREP = "SHARD_03_"
  121. }
  122. steps {
  123. dir('services/filestore') {
  124. retry(count: 3) {
  125. sh 'make test_acceptance'
  126. }
  127. }
  128. }
  129. }
  130. }
  131. }
  132. stage('Push Production') {
  133. steps {
  134. dir('services/filestore') {
  135. sh 'make push'
  136. }
  137. }
  138. }
  139. }
  140. post {
  141. always {
  142. junit checksName: 'filestore test results', testResults: 'services/filestore/reports/junit-*.xml'
  143. }
  144. cleanup {
  145. dir('services/filestore') {
  146. sh 'make clean'
  147. }
  148. sh 'make clean_jenkins -j10'
  149. }
  150. }
  151. }