Files
overleaf-cep/services/git-bridge/Jenkinsfile
Jakob Ackermann 79eabd511e [monorepo] use content hash as docker image cache key (#29046)
* [monorepo] remove docker-repos flag from build scripts

* [monorepo] use content hash as docker image cache key

* [packer] jenkins-worker: populate build cache for all services

* [v1] adopt smarter docker caching

* [latexqc] adopt smarter docker caching

* [monorepo] refresh docker cache in Jenkins

* [packer] jenkins-worker: increase disk size

* [monorepo] run jenkins_docker_build_cache as Jenkins user for v1

* [monorepo] define MONOREPO at the top of all the Makefiles

* [monorepo] add --build-arg BUILDKIT_INLINE_CACHE=1 everywhere

GitOrigin-RevId: 8110c6e68727a52ea80f3ec71711d30e17d69499
2025-10-15 08:06:41 +00:00

84 lines
1.9 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') {
sh 'make refresh_cache -j2'
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 -j10'
}
}
}