mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 09:09:36 +02:00
* [monorepo] migrate build scripts to Jenkins * [fraud-dash] fix integration with monorepo GitOrigin-RevId: 6a30ec5ea68a1eae9b663faf9ccdc741ec7f9cf8
125 lines
3.1 KiB
Groovy
125 lines
3.1 KiB
Groovy
// Autogenerated by build scripts. Do not edit.
|
|
|
|
pipeline {
|
|
agent {
|
|
node {
|
|
label 'jenkins-agent-web'
|
|
customWorkspace '/workspace'
|
|
}
|
|
}
|
|
options {
|
|
timestamps()
|
|
timeout(time: 15, unit: 'MINUTES')
|
|
}
|
|
environment {
|
|
BRANCH_NAME = "${env.CHANGE_BRANCH ? env.CHANGE_BRANCH : env.BRANCH_NAME}"
|
|
JENKINS_BUILD_NUMBER = "${BUILD_NUMBER}"
|
|
BUILD_NUMBER = "${SHORT_SHA}_${BUILD_NUMBER}"
|
|
DOCKER_COMPOSE_FLAGS = '-f docker-compose.ci.yml'
|
|
COMMIT_SHA = "${GIT_COMMIT}"
|
|
SHORT_SHA = "${GIT_COMMIT.take(7)}"
|
|
}
|
|
stages {
|
|
stage('Stage 1') {
|
|
parallel {
|
|
stage('Build') {
|
|
steps {
|
|
dir('services/document-updater') {
|
|
retry(count: 3) {
|
|
sh 'make build'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
stage('Create reports folder') {
|
|
steps {
|
|
sh 'mkdir services/document-updater/reports'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
stage('Stage 2') {
|
|
parallel {
|
|
stage('Push Branch Image') {
|
|
steps {
|
|
dir('services/document-updater') {
|
|
sh 'make push_branch'
|
|
}
|
|
}
|
|
}
|
|
stage('Shellcheck') {
|
|
steps {
|
|
dir('services/document-updater') {
|
|
sh 'make shellcheck'
|
|
}
|
|
}
|
|
}
|
|
stage('Lint') {
|
|
steps {
|
|
dir('services/document-updater') {
|
|
sh 'make lint_ci'
|
|
}
|
|
}
|
|
post {
|
|
always {
|
|
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')]
|
|
}
|
|
}
|
|
}
|
|
stage('Format') {
|
|
steps {
|
|
dir('services/document-updater') {
|
|
sh 'make format_ci'
|
|
}
|
|
}
|
|
}
|
|
stage('Typecheck') {
|
|
steps {
|
|
dir('services/document-updater') {
|
|
sh 'make typecheck_ci'
|
|
}
|
|
}
|
|
}
|
|
stage('Test Unit') {
|
|
steps {
|
|
dir('services/document-updater') {
|
|
retry(count: 3) {
|
|
sh 'make test_unit'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
stage('Test Acceptance') {
|
|
environment {
|
|
COMPOSE_PROJECT_NAME_TEST_ACCEPTANCE = "test_acceptance"
|
|
}
|
|
steps {
|
|
dir('services/document-updater') {
|
|
retry(count: 3) {
|
|
sh 'make test_acceptance'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
stage('Push Production') {
|
|
steps {
|
|
dir('services/document-updater') {
|
|
sh 'make push'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
post {
|
|
always {
|
|
junit checksName: 'document-updater test results', testResults: 'services/document-updater/reports/junit-*.xml'
|
|
}
|
|
cleanup {
|
|
dir('services/document-updater') {
|
|
sh 'make clean'
|
|
}
|
|
sh 'make clean_jenkins -j10'
|
|
}
|
|
}
|
|
} |