Jenkinsfile 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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/settings/reports'
  33. }
  34. }
  35. }
  36. }
  37. stage('Stage 2') {
  38. parallel {
  39. stage('Lint') {
  40. steps {
  41. sh 'bin/run -w /overleaf/libraries/settings 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/settings/reports/eslint.json
  47. """
  48. recordIssues checksAnnotationScope: 'ALL', enabledForFailure: true, failOnError: true, id: 'settings-eslint', name: 'settings eslint', qualityGates: [[integerThreshold: 1, threshold: 1.0, type: 'TOTAL']], sourceCodeRetention: 'LAST_BUILD', tools: [esLint(pattern: 'libraries/settings/reports/eslint.json')]
  49. }
  50. }
  51. }
  52. stage('Format') {
  53. steps {
  54. sh 'bin/run -w /overleaf/libraries/settings monorepo npm run format'
  55. }
  56. }
  57. stage('Typecheck') {
  58. steps {
  59. sh 'bin/run -w /overleaf/libraries/settings monorepo npm run types:check'
  60. }
  61. }
  62. }
  63. }
  64. }
  65. post {
  66. cleanup {
  67. sh 'rm -rf libraries/settings/reports'
  68. sh 'make clean_jenkins -j10'
  69. }
  70. }
  71. }