mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 13:13:45 +01:00
Enable Jenkins hooks for creating GitHub issues for all pipelines with owners GitOrigin-RevId: ba46db1d3137db12ee5c78f09b126fb9927d9c49
65 lines
1.4 KiB
Groovy
65 lines
1.4 KiB
Groovy
pipeline {
|
|
agent {
|
|
node {
|
|
// Select a VM with the given tabel.
|
|
label 'jenkins-agent-web'
|
|
// Use the monorepo checkout in /workspace.
|
|
customWorkspace '/workspace'
|
|
}
|
|
}
|
|
options {
|
|
// Print timestamp next to each log line.
|
|
timestamps()
|
|
timeout(time: 15, unit: 'MINUTES')
|
|
}
|
|
environment {
|
|
BRANCH_NAME = "${env.CHANGE_BRANCH ? env.CHANGE_BRANCH : env.BRANCH_NAME}"
|
|
BUCKET = "gs://overleaf-dev-storybook"
|
|
}
|
|
stages {
|
|
stage('Install') {
|
|
steps {
|
|
retry(count: 3) {
|
|
sh 'make monorepo_setup'
|
|
}
|
|
}
|
|
}
|
|
stage('Build') {
|
|
steps {
|
|
sh 'bin/run -e BRANCH_NAME -w /overleaf/services/web monorepo make build_storybook'
|
|
}
|
|
}
|
|
stage('Copy stories') {
|
|
steps {
|
|
sh 'gsutil -m copy -r services/web/data/storybook/* "${BUCKET}/"'
|
|
}
|
|
}
|
|
stage('Generate index') {
|
|
steps {
|
|
dir('services/web') {
|
|
sh 'make storybook_index'
|
|
}
|
|
}
|
|
}
|
|
stage('Copy index') {
|
|
steps {
|
|
sh 'gsutil copy services/web/data/storybook/index.html "${BUCKET}/index.html"'
|
|
}
|
|
}
|
|
}
|
|
post {
|
|
failure {
|
|
script {
|
|
if (env.BRANCH_NAME == 'main') {
|
|
node('built-in') {
|
|
sh '/usr/local/bin/open-gh-failure-issue --project="🚉 Platform"'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
cleanup {
|
|
sh 'rm -rf services/web/data/storybook/'
|
|
sh 'make clean_jenkins -j10'
|
|
}
|
|
}
|
|
} |