Update Jenkinsfile
Gitea/deathwatch-d10/pipeline/head There was a failure building this commit Details

This commit is contained in:
Dandaedre 2025-07-02 21:56:40 +02:00
parent 0a6e5348cf
commit 318de94841
1 changed files with 18 additions and 70 deletions

88
Jenkinsfile vendored
View File

@ -7,10 +7,13 @@ pipeline {
================== */
environment {
MDBOOK_BUILD_DIR = "book" // Don't change, it allows the build script & mdBook to know where the book is
DEPLOY_DIR = "/mnt/books/deathwatch-d10" // Important, all books are in /mnt/books
PATH="${PATH}:/root/.cargo/bin:/usr/local/bin/" // Important, don't change
RUSTUP_TOOLCHAIN="stable" // Important, don't change unless you need nightly ?
MDBOOK_BUILD_DIR_P = "book_players"
MDBOOK_BUILD_DIR_M = "book_master"
DEPLOY_DIR_P = "/mnt/books/deathwatch-d10"
DEPLOY_DIR_M = "/mnt/books/deathwatch-d10-master"
PATH="${PATH}:/root/.cargo/bin:/usr/local/bin/"
RUSTUP_TOOLCHAIN="stable"
// MDBOOK_PREPROCESSOR__HIDE=false
}
stages {
@ -36,9 +39,15 @@ pipeline {
END USER CONFIG
================== */
stage('Build Book') {
stage('Build Book: Players') {
steps {
sh 'mdbook build'
sh 'MDBOOK_PREPROCESSOR__HIDE=true mdbook build -d ${MDBOOK_BUILD_DIR_P}'
}
}
stage('Build Book: Master') {
steps {
sh 'MDBOOK_PREPROCESSOR__HIDE=false mdbook build -d ${MDBOOK_BUILD_DIR_M}'
}
}
@ -46,7 +55,8 @@ pipeline {
steps {
sh 'echo "Deploying to ${DEPLOY_DIR}"'
sh 'mkdir -p ${DEPLOY_DIR}'
sh 'rsync -a --delete ${MDBOOK_BUILD_DIR}/ ${DEPLOY_DIR}'
sh 'rsync -a --delete ${MDBOOK_BUILD_DIR_P}/ ${DEPLOY_DIR_P}'
sh 'rsync -a --delete ${MDBOOK_BUILD_DIR_M}/ ${DEPLOY_DIR_M}'
}
}
}
@ -59,66 +69,4 @@ pipeline {
echo '❌ mdbook Failed to Build'
}
}
}
pipeline {
agent { label 'rust_no_docker' } // any COULD work, but prefer this label for mdbooks
/* ===============
BEGIN USER CONFIG
================== */
environment {
MDBOOK_BUILD_DIR = "book_master" // Don't change, it allows the build script & mdBook to know where the book is
DEPLOY_DIR = "/mnt/books/deathwatch-d10-master" // Important, all books are in /mnt/books
PATH="${PATH}:/root/.cargo/bin:/usr/local/bin/" // Important, don't change
RUSTUP_TOOLCHAIN="stable" // Important, don't change unless you need nightly ?
MDBOOK_PREPROCESSOR__HIDE=false
}
stages {
stage('Checkout') {
steps {
checkout scm // Checkout intead of full clone
}
}
stage('Install mdBook') {
steps {
sh 'cargo install mdbook || echo "mdBook already installed"' // Install the latest mdBooks
}
}
stage('Install plugins'){
steps {
sh 'cargo install mdbook-admonish mdbook-alerts mdbook-hide mdbook-image-size'
}
}
/* ===============
END USER CONFIG
================== */
stage('Build Book') {
steps {
sh 'mdbook build'
}
}
stage('Deploy to Books') {
steps {
sh 'echo "Deploying to ${DEPLOY_DIR}"'
sh 'mkdir -p ${DEPLOY_DIR}'
sh 'rsync -a --delete ${MDBOOK_BUILD_DIR}/ ${DEPLOY_DIR}'
}
}
}
post {
success {
echo '✅ mdBook Build!'
}
failure {
echo '❌ mdbook Failed to Build'
}
}
}
}