Update Jenkinsfile
This commit is contained in:
parent
e929ba81c0
commit
ba0443218a
|
|
@ -1,21 +1,27 @@
|
|||
// Don't forget to add http://192.168.1.37:8080/gitea-webhook/post as a gitea webhook
|
||||
// Don't forget to add http://jenkins.dandaedre.com/gitea-webhook/post as a gitea webhook if is not in your organisation
|
||||
|
||||
pipeline {
|
||||
agent { label 'rust_no_docker' } // any COULD work, but prefer this label for mdbooks
|
||||
|
||||
/* ===============
|
||||
BEGIN USER CONFIG
|
||||
================== */
|
||||
|
||||
environment {
|
||||
// Change with desired plugins, comment the node "Install plugins if no plugins are needed"
|
||||
MDB_PLUGIN_LIST = "mdbook-admonish mdbook-alerts mdbook-hide mdbook-image-size"
|
||||
|
||||
BUILD_DIR_P = "book_players"
|
||||
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/"
|
||||
// PATH="${PATH}:/root/.cargo/bin:/usr/local/bin/"
|
||||
RUSTUP_TOOLCHAIN="stable"
|
||||
// MDBOOK_PREPROCESSOR__HIDE=false
|
||||
}
|
||||
|
||||
/* ===============
|
||||
END USER CONFIG
|
||||
================== */
|
||||
stages {
|
||||
stage('Checkout') {
|
||||
steps {
|
||||
|
|
@ -31,14 +37,10 @@ pipeline {
|
|||
|
||||
stage('Install plugins'){
|
||||
steps {
|
||||
sh 'cargo install mdbook-admonish mdbook-alerts mdbook-hide mdbook-image-size'
|
||||
sh 'cargo install ${MDB_PLUGIN_LIST}'
|
||||
}
|
||||
}
|
||||
|
||||
/* ===============
|
||||
END USER CONFIG
|
||||
================== */
|
||||
|
||||
stage('Build Book: Players') {
|
||||
steps {
|
||||
sh 'mdbook build -d ${BUILD_DIR_P}'
|
||||
|
|
@ -51,6 +53,21 @@ pipeline {
|
|||
}
|
||||
}
|
||||
|
||||
stage('Scan Warnings') {
|
||||
steps {
|
||||
// warnError('Scanning warnings') {
|
||||
// withChecks('Parsing: ', includeStage: true) {
|
||||
recordIssues tools: [
|
||||
groovyScript('mdbook_preprocessor_import')
|
||||
],
|
||||
qualityGates: [
|
||||
[threshold: 1, type: 'TOTAL', unstable: true, criticality: 'UNSTABLE'],
|
||||
[threshold: 1, type: 'TOTAL_ERROR', unstable: true, criticality: 'UNSTABLE']
|
||||
]
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
stage('Deploy to Books') {
|
||||
steps {
|
||||
sh 'echo "Deploying to ${DEPLOY_DIR_P} & ${DEPLOY_DIR_M}"'
|
||||
|
|
@ -64,10 +81,15 @@ pipeline {
|
|||
|
||||
post {
|
||||
success {
|
||||
echo '✅ mdBook Build!'
|
||||
publishChecks conclusion: 'SUCCESS', name: 'Build Successful', summary: 'The build was successful', text: 'The build was sucessful', title: 'Build Successful'
|
||||
echo '✅mdBook Built!'
|
||||
}
|
||||
failure {
|
||||
echo '❌ mdbook Failed to Build'
|
||||
publishChecks conclusion: 'FAILURE', name: 'Build Failed', summary: 'The build failed', text: 'The build was a failure', title: 'Build failed'
|
||||
echo '❌mdbook Failed to Build'
|
||||
}
|
||||
unstable{
|
||||
publishChecks conclusion: 'ACTION_REQUIRED', name: 'Build Unstable', summary: 'Unstable do to plugins missing', text: 'Unstable do to plugins missing', title: 'Build Unstable'
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue