Add Jenkinsfile
Gitea/deathwatch-d10/pipeline/head This commit looks good
Details
Gitea/deathwatch-d10/pipeline/head This commit looks good
Details
This commit is contained in:
parent
891adf4b1a
commit
89c4f27a8e
|
|
@ -0,0 +1,62 @@
|
|||
// Don't forget to add http://192.168.1.37:8080/gitea-webhook/post as a gitea webhook
|
||||
|
||||
pipeline {
|
||||
agent { label 'rust_no_docker' } // any COULD work, but prefer this label for mdbooks
|
||||
/* ===============
|
||||
BEGIN USER CONFIG
|
||||
================== */
|
||||
|
||||
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 ?
|
||||
}
|
||||
|
||||
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'
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue