[monorepo] run prettier on Jenkinsfiles (#28565)

* [monorepo] consolidate .editorconfig files at the root

* [monorepo] run prettier on Jenkinsfiles

* [saas-e2e] increase timeout for XeTeX compile

GitOrigin-RevId: 48aa82f7c81611899837753ae92c7732998d4ca5
This commit is contained in:
Jakob Ackermann
2025-09-18 14:11:05 +02:00
committed by Copybot
parent 66934586b1
commit a6e9a5c7e9
24 changed files with 310 additions and 276 deletions

View File

@@ -1,110 +1,104 @@
pipeline {
agent {
node {
label 'jenkins-agent-web'
customWorkspace '/workspace'
agent {
node {
label 'jenkins-agent-web'
customWorkspace '/workspace'
}
}
options {
timestamps()
parallelsAlwaysFailFast()
retry(3)
timeout(time: 15, unit: 'MINUTES')
}
environment {
IMAGE_NAME = 'contacts'
PROJECT_NAME = 'contacts'
IMAGE_REPO = 'us-east1-docker.pkg.dev/overleaf-ops/ol-docker/contacts'
AR_REPO_LOCATION = 'us-east1'
AR_URL = 'us-east1-docker.pkg.dev/overleaf-ops/ol-docker'
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 ('Build') {
steps {
dir ('services/contacts') {
sh 'make build'
}
}
}
options {
timestamps()
parallelsAlwaysFailFast()
retry(3)
timeout(time: 15, unit: 'MINUTES')
}
environment {
IMAGE_NAME = 'contacts'
PROJECT_NAME = 'contacts'
IMAGE_REPO = 'us-east1-docker.pkg.dev/overleaf-ops/ol-docker/contacts'
AR_REPO_LOCATION = 'us-east1'
AR_URL = 'us-east1-docker.pkg.dev/overleaf-ops/ol-docker'
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 ('Build') {
steps {
dir ('services/contacts') {
sh 'make build'
}
stage ('Tests') {
parallel {
stage ('Push Branch Image') {
steps {
dir ('services/contacts') {
sh 'docker push ${AR_URL}/${IMAGE_NAME}:${BRANCH_NAME}'
}
}
}
stage ('Tests') {
parallel {
stage ('Push Branch Image') {
steps {
dir ('services/contacts') {
sh 'docker push ${AR_URL}/${IMAGE_NAME}:${BRANCH_NAME}'
}
}
}
stage ('Shellcheck') {
steps {
dir ('services/contacts') {
sh 'make shellcheck'
}
}
}
stage ('Lint') {
steps {
dir ('services/contacts') {
sh 'make lint_ci'
}
}
}
stage ('Format') {
steps {
dir ('services/contacts') {
sh 'make format_ci'
}
}
}
stage ('Typecheck') {
steps {
dir ('services/contacts') {
sh 'make typecheck_ci'
}
}
}
stage ('Test Unit') {
steps {
dir ('services/contacts') {
sh 'make test_unit'
}
}
}
stage ('Test Acceptance') {
steps {
dir ('services/contacts') {
sh 'make test_acceptance'
}
}
}
stage ('Shellcheck') {
steps {
dir ('services/contacts') {
sh 'make shellcheck'
}
}
}
stage('Push Production') {
steps {
dir('services/contacts') {
sh 'docker push ${AR_URL}/${IMAGE_NAME}:${BRANCH_NAME}-${BUILD_NUMBER}'
}
stage ('Lint') {
steps {
dir ('services/contacts') {
sh 'make lint_ci'
}
}
}
stage ('Format') {
steps {
dir ('services/contacts') {
sh 'make format_ci'
}
}
}
stage ('Typecheck') {
steps {
dir ('services/contacts') {
sh 'make typecheck_ci'
}
}
}
stage ('Test Unit') {
steps {
dir ('services/contacts') {
sh 'make test_unit'
}
}
}
stage ('Test Acceptance') {
steps {
dir ('services/contacts') {
sh 'make test_acceptance'
}
}
}
}
}
post {
cleanup {
dir('services/contacts') {
sh 'make clean'
}
sh 'make clean_jenkins'
stage('Push Production') {
steps {
dir('services/contacts') {
sh 'docker push ${AR_URL}/${IMAGE_NAME}:${BRANCH_NAME}-${BUILD_NUMBER}'
}
}
}
}
}
post {
cleanup {
dir('services/contacts') {
sh 'make clean'
}
sh 'make clean_jenkins'
}
}
}

View File

@@ -12,8 +12,8 @@
"test:unit": "npm run test:unit:_run -- --grep=$MOCHA_GREP",
"nodemon": "node --watch app.js",
"lint": "eslint --max-warnings 0 --format unix .",
"format": "prettier --list-different $PWD/'**/*.*js'",
"format:fix": "prettier --write $PWD/'**/*.*js'",
"format": "prettier --list-different $PWD/'**/{*.*js,Jenkinsfile}'",
"format:fix": "prettier --write $PWD/'**/{*.*js,Jenkinsfile}'",
"lint:fix": "eslint --fix .",
"types:check": "tsc --noEmit"
},