Jenkinsfile 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. COMMIT_SHA = "${GIT_COMMIT}"
  18. SHORT_SHA = "${GIT_COMMIT.take(7)}"
  19. }
  20. stages {
  21. stage('Stage 1') {
  22. parallel {
  23. stage('Install monorepo') {
  24. steps {
  25. retry(count: 3) {
  26. sh 'make monorepo_setup'
  27. }
  28. }
  29. }
  30. stage('Create reports folder') {
  31. steps {
  32. sh 'mkdir libraries/fetch-utils/reports'
  33. }
  34. }
  35. }
  36. }
  37. stage('Stage 2') {
  38. parallel {
  39. stage('Lint') {
  40. steps {
  41. sh 'bin/run -w /overleaf/libraries/fetch-utils monorepo npm run lint -- --format json --output-file reports/eslint.json'
  42. }
  43. post {
  44. always {
  45. sh """
  46. sed -i 's_"filePath":"/overleaf_"filePath":"/workspace_g' libraries/fetch-utils/reports/eslint.json
  47. """
  48. recordIssues checksAnnotationScope: 'ALL', enabledForFailure: true, failOnError: true, id: 'fetch-utils-eslint', name: 'fetch-utils eslint', qualityGates: [[integerThreshold: 1, threshold: 1.0, type: 'TOTAL']], sourceCodeRetention: 'LAST_BUILD', tools: [esLint(pattern: 'libraries/fetch-utils/reports/eslint.json')]
  49. }
  50. }
  51. }
  52. stage('Format') {
  53. steps {
  54. sh 'bin/run -w /overleaf/libraries/fetch-utils monorepo npm run format'
  55. }
  56. }
  57. stage('Typecheck') {
  58. steps {
  59. sh 'bin/run -w /overleaf/libraries/fetch-utils monorepo npm run types:check'
  60. }
  61. }
  62. stage('Test') {
  63. steps {
  64. retry(count: 3) {
  65. sh 'bin/run -w /overleaf/libraries/fetch-utils monorepo npm run test:ci'
  66. }
  67. }
  68. }
  69. }
  70. }
  71. }
  72. post {
  73. always {
  74. junit checksName: 'fetch-utils test results', testResults: 'libraries/fetch-utils/reports/junit-*.xml'
  75. }
  76. cleanup {
  77. sh 'rm -rf libraries/fetch-utils/reports'
  78. sh 'make clean_jenkins -j10'
  79. }
  80. }
  81. }