Jenkinsfile 3.1 KB

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