erpnext/Jenkinsfile
Tyler Landes f57072667c Split Jenkins CI into visible stages for Coolify ERPNext validation.
Each check runs in its own pipeline stage (readiness, compose, image pull) so Jenkins shows clear pass/fail per section.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-16 18:43:02 -04:00

69 lines
1.7 KiB
Groovy

// ERPNext → Coolify production CI (Forgejo: epistemophiliac/erpnext)
pipeline {
agent any
options {
timestamps()
disableConcurrentBuilds()
buildDiscarder(logRotator(numToKeepStr: '20'))
}
stages {
stage('Verify') {
steps {
sh '''
echo "=== ERPNext Coolify CI ==="
echo "commit: $(git rev-parse --short HEAD)"
echo "branch: ${BRANCH_NAME:-main}"
test -f Jenkinsfile
test -f docker-compose.yml
test -f example.env
'''
}
}
stage('Production readiness') {
steps {
sh '''
chmod +x scripts/ci/*.sh
bash scripts/ci/ci-readiness.sh .
bash scripts/ci/validate-docker-compose.sh .
'''
}
}
stage('Bootstrap Docker tools') {
steps {
sh 'bash scripts/ci/jenkins-bootstrap.sh'
}
}
stage('Compose validate') {
steps {
sh '''
source .ci-bin/ci-env.sh
mkdir -p dist
sed '/exclude_from_hc:/d' docker-compose.yml > dist/docker-compose.coolify.yml
$COMPOSE -f dist/docker-compose.coolify.yml config -q
echo "Coolify-safe compose validates"
'''
}
}
stage('Verify ERPNext image') {
steps {
sh 'bash scripts/ci/jenkins-pull-image.sh'
}
}
}
post {
success {
archiveArtifacts artifacts: 'dist/docker-compose.coolify.yml', fingerprint: true, onlyIfSuccessful: true
echo 'CI passed — safe to deploy docker-compose.yml on Coolify (set DB_PASSWORD, SITE_NAME, ADMIN_PASSWORD).'
}
failure {
echo 'CI failed — do not deploy to Coolify until this build is green.'
}
}
}