Files
rfc-index/Jenkinsfile
2025-12-22 15:00:09 +02:00

60 lines
1.3 KiB
Groovy

#!/usr/bin/env groovy
library 'status-jenkins-lib@v1.9.31'
pipeline {
agent {
docker {
label 'linuxcontainer'
image 'harbor.status.im/infra/ci-build-containers:linux-base-1.0.0'
args '--volume=/nix:/nix ' +
'--volume=/etc/nix:/etc/nix ' +
'--user jenkins'
}
}
options {
disableConcurrentBuilds()
buildDiscarder(logRotator(
numToKeepStr: '20',
daysToKeepStr: '30',
))
}
environment {
GIT_COMMITTER_NAME = 'status-im-auto'
GIT_COMMITTER_EMAIL = 'auto@status.im'
}
stages {
stage('Build') {
steps { script {
nix.develop('python scripts/gen_rfc_index.py && python scripts/gen_history.py && mdbook build')
jenkins.genBuildMetaJSON('book/build.json')
} }
}
stage('Publish') {
steps {
sshagent(credentials: ['status-im-auto-ssh']) {
script {
nix.develop("""
ghp-import \
-b ${deployBranch()} \
-c ${deployDomain()} \
-p book
""", pure: false)
}
}
}
}
}
post {
cleanup { cleanWs() }
}
}
def isMainBranch() { GIT_BRANCH ==~ /.*main/ }
def deployBranch() { isMainBranch() ? 'deploy-master' : 'deploy-develop' }
def deployDomain() { isMainBranch() ? 'rfc.vac.dev' : 'dev-rfc.vac.dev' }