Files
overleaf/services/git-bridge/Jenkinsfile
Jakob Ackermann d7623b576f [monorepo] refactor retries in Jenkins to step level (#29008)
* [monorepo] refactor retries in Jenkins to step level

Change the junit reports to use step specific file names. The [hash]
template option was neat in getting unique file names, but results in
duplicate test reports on retry.

* [patches] add support for .cjs config files for mocha-multi-reporters

GitOrigin-RevId: 3a749441470b5ba633e71319589606cfbe860952
2025-10-13 08:06:37 +00:00

83 lines
1.8 KiB
Groovy

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}"
COMMIT_SHA = "${GIT_COMMIT}"
SHORT_SHA = "${GIT_COMMIT.take(7)}"
}
stages {
stage('Stage 1') {
parallel {
stage('Build') {
steps {
dir('services/git-bridge') {
retry(count: 3) {
sh 'make docker_build_base'
}
}
}
}
}
}
stage('Stage 2') {
parallel {
stage('Build production and push') {
steps {
dir('services/git-bridge') {
retry(count: 3) {
sh 'make docker_build'
}
sh 'make push_branch'
}
}
}
stage('Format Java') {
steps {
dir('services/git-bridge') {
sh 'make docker_format'
}
}
}
stage('Test') {
steps {
dir('services/git-bridge') {
retry(count: 3) {
sh 'make docker_test'
}
}
}
}
}
}
stage('Push Production') {
steps {
dir('services/git-bridge') {
sh 'make push'
}
}
}
}
post {
// Collect junit test results for both success and failure case.
always {
junit checksName: 'git-bridge test results', testResults: 'services/git-bridge/target/surefire-reports/*.xml'
}
cleanup {
dir('services/git-bridge') {
sh 'make clean_ci'
}
sh 'make clean_jenkins'
}
}
}