epoch_forge/Jenkinsfile

60 lines
1.9 KiB
Groovy

// Don't forget to add http://192.168.1.37:8080/gitea-webhook/post as a gitea webhook
pipeline {
agent { label 'rust_no_docker' }
/* ===============
BEGIN USER CONFIG
================== */
environment {
DEPLOY_DIR = "/mnt/books/" // Important, all books are in /mnt/book
}
stages {
stage('Checkout') {
steps {
checkout scm // Checkout intead of full clone
}
}
stage('Update') {
steps {
sh "rustup update"
// sh "rustup show"
}
}
/* ===============
END USER CONFIG
================== */
stage('Build Book') {
steps {
script {
if (env.BRANCH_NAME == 'origin/review' || env.BRANCH_NAME == 'review' || env.BRANCH_NAME == 'origin/dev-ci' || env.BRANCH_NAME == 'dev-ci') {
sh 'cargo test'
} else if (env.BRANCH_NAME == 'origin/master' || env.BRANCH_NAME == 'master') {
sh 'cargo test'
} else {
echo "Unknown branch: ${env.BRANCH_NAME} - skipping build."
}
}
}
}
}
post {
success {
publishChecks conclusion: 'SUCCESS', name: 'Build Successful', summary: 'The build was successful', text: 'The build was sucessful', title: 'Build Successful'
echo '✅Site Deployed!'
}
failure {
publishChecks conclusion: 'FAILURE', name: 'Build Failed', summary: 'The build failed', text: 'The build was a failure', title: 'Build failed'
echo '❌Site Failed to Deploy'
}
unstable{
publishChecks conclusion: 'ACTION_REQUIRED', name: 'Build Unstable', summary: 'Unstable build', text: 'Unstable build', title: 'Build Unstable'
}
}
}