CI revision 4: move pipeline logic to scripts/ci/jenkins-run.sh
Minimal Jenkinsfile so Jenkins must checkout repo before running CI. Look for "erpnext CI revision 4" in build log to confirm latest code.
This commit is contained in:
parent
ab248f3665
commit
a644d2df3d
2 changed files with 41 additions and 67 deletions
71
Jenkinsfile
vendored
71
Jenkinsfile
vendored
|
|
@ -1,79 +1,16 @@
|
|||
// erpnext CI — revision 3 (docker-compose standalone, explicit paths)
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
options {
|
||||
timestamps()
|
||||
disableConcurrentBuilds()
|
||||
skipDefaultCheckout(false)
|
||||
}
|
||||
|
||||
environment {
|
||||
CI_BIN = "${WORKSPACE}/.ci-bin"
|
||||
DOCKER_BIN = "${WORKSPACE}/.ci-bin/docker"
|
||||
COMPOSE_BIN = "${WORKSPACE}/.ci-bin/docker-compose"
|
||||
COMPOSE_FILE = "${WORKSPACE}/dist/docker-compose.coolify.yml"
|
||||
}
|
||||
|
||||
options { timestamps() }
|
||||
stages {
|
||||
stage('Verify checkout') {
|
||||
stage('CI') {
|
||||
steps {
|
||||
sh 'echo "CI revision 3 | commit $(git rev-parse --short HEAD)"'
|
||||
sh 'test -f Jenkinsfile && test -f docker-compose.yml'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Production readiness') {
|
||||
steps {
|
||||
sh 'chmod +x scripts/ci/*.sh'
|
||||
sh 'bash scripts/ci/ci-readiness.sh .'
|
||||
sh 'bash scripts/ci/validate-docker-compose.sh .'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Install CI tools') {
|
||||
steps {
|
||||
sh '''
|
||||
set -euo pipefail
|
||||
mkdir -p .ci-bin dist
|
||||
|
||||
if [ ! -x .ci-bin/docker ]; then
|
||||
echo "Downloading docker CLI..."
|
||||
curl -fsSL "https://download.docker.com/linux/static/stable/x86_64/docker-27.4.1.tgz" \
|
||||
| tar xz --strip-components=1 -C .ci-bin docker/docker
|
||||
chmod +x .ci-bin/docker
|
||||
fi
|
||||
|
||||
if [ ! -x .ci-bin/docker-compose ]; then
|
||||
echo "Downloading docker-compose..."
|
||||
curl -fsSL "https://github.com/docker/compose/releases/download/v2.32.4/docker-compose-linux-x86_64" \
|
||||
-o .ci-bin/docker-compose
|
||||
chmod +x .ci-bin/docker-compose
|
||||
fi
|
||||
|
||||
.ci-bin/docker version
|
||||
.ci-bin/docker-compose version
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
||||
stage('Compose smoke') {
|
||||
steps {
|
||||
sh '''
|
||||
set -euo pipefail
|
||||
sed '/exclude_from_hc:/d' docker-compose.yml > dist/docker-compose.coolify.yml
|
||||
.ci-bin/docker-compose -f dist/docker-compose.coolify.yml config -q
|
||||
VERSION="$(grep -E '^ERPNEXT_VERSION=' example.env | cut -d= -f2)"
|
||||
.ci-bin/docker pull "frappe/erpnext:${VERSION}"
|
||||
echo "frappe/erpnext:${VERSION} OK"
|
||||
'''
|
||||
sh 'bash scripts/ci/jenkins-run.sh'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
post {
|
||||
success {
|
||||
archiveArtifacts artifacts: 'dist/docker-compose.coolify.yml', fingerprint: true, onlyIfSuccessful: true
|
||||
archiveArtifacts artifacts: 'dist/docker-compose.coolify.yml', onlyIfSuccessful: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
37
scripts/ci/jenkins-run.sh
Executable file
37
scripts/ci/jenkins-run.sh
Executable file
|
|
@ -0,0 +1,37 @@
|
|||
#!/usr/bin/env bash
|
||||
# erpnext Jenkins CI — revision 4
|
||||
set -euo pipefail
|
||||
|
||||
echo "=== erpnext CI revision 4 ==="
|
||||
echo "commit: $(git rev-parse --short HEAD 2>/dev/null || echo unknown)"
|
||||
echo "workspace: ${PWD}"
|
||||
|
||||
chmod +x scripts/ci/*.sh
|
||||
bash scripts/ci/ci-readiness.sh .
|
||||
bash scripts/ci/validate-docker-compose.sh .
|
||||
|
||||
mkdir -p .ci-bin dist
|
||||
|
||||
if [ ! -x .ci-bin/docker ]; then
|
||||
echo "Downloading docker CLI..."
|
||||
curl -fsSL "https://download.docker.com/linux/static/stable/x86_64/docker-27.4.1.tgz" \
|
||||
| tar xz --strip-components=1 -C .ci-bin docker/docker
|
||||
chmod +x .ci-bin/docker
|
||||
fi
|
||||
|
||||
if [ ! -x .ci-bin/docker-compose ]; then
|
||||
echo "Downloading docker-compose..."
|
||||
curl -fsSL "https://github.com/docker/compose/releases/download/v2.32.4/docker-compose-linux-x86_64" \
|
||||
-o .ci-bin/docker-compose
|
||||
chmod +x .ci-bin/docker-compose
|
||||
fi
|
||||
|
||||
.ci-bin/docker version
|
||||
.ci-bin/docker-compose version
|
||||
|
||||
sed '/exclude_from_hc:/d' docker-compose.yml > dist/docker-compose.coolify.yml
|
||||
.ci-bin/docker-compose -f dist/docker-compose.coolify.yml config -q
|
||||
|
||||
VERSION="$(grep -E '^ERPNEXT_VERSION=' example.env | cut -d= -f2)"
|
||||
.ci-bin/docker pull "frappe/erpnext:${VERSION}"
|
||||
echo "frappe/erpnext:${VERSION} OK"
|
||||
Loading…
Reference in a new issue