Rewrite Jenkinsfile (CI revision 3)
Use explicit .ci-bin/docker-compose paths only; split install and smoke stages; print commit SHA so builds are not confused with old replays.
This commit is contained in:
parent
752f6da269
commit
ab248f3665
1 changed files with 30 additions and 9 deletions
39
Jenkinsfile
vendored
39
Jenkinsfile
vendored
|
|
@ -1,12 +1,28 @@
|
||||||
|
// erpnext CI — revision 3 (docker-compose standalone, explicit paths)
|
||||||
pipeline {
|
pipeline {
|
||||||
agent any
|
agent any
|
||||||
|
|
||||||
options {
|
options {
|
||||||
timestamps()
|
timestamps()
|
||||||
disableConcurrentBuilds()
|
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"
|
||||||
}
|
}
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
|
stage('Verify checkout') {
|
||||||
|
steps {
|
||||||
|
sh 'echo "CI revision 3 | commit $(git rev-parse --short HEAD)"'
|
||||||
|
sh 'test -f Jenkinsfile && test -f docker-compose.yml'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
stage('Production readiness') {
|
stage('Production readiness') {
|
||||||
steps {
|
steps {
|
||||||
sh 'chmod +x scripts/ci/*.sh'
|
sh 'chmod +x scripts/ci/*.sh'
|
||||||
|
|
@ -15,35 +31,40 @@ pipeline {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Compose smoke') {
|
stage('Install CI tools') {
|
||||||
steps {
|
steps {
|
||||||
sh '''
|
sh '''
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
mkdir -p .ci-bin dist
|
mkdir -p .ci-bin dist
|
||||||
|
|
||||||
if [ ! -x .ci-bin/docker ]; then
|
if [ ! -x .ci-bin/docker ]; then
|
||||||
echo "Installing static docker CLI..."
|
echo "Downloading docker CLI..."
|
||||||
curl -fsSL "https://download.docker.com/linux/static/stable/x86_64/docker-27.4.1.tgz" \
|
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
|
| tar xz --strip-components=1 -C .ci-bin docker/docker
|
||||||
chmod +x .ci-bin/docker
|
chmod +x .ci-bin/docker
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -x .ci-bin/docker-compose ]; then
|
if [ ! -x .ci-bin/docker-compose ]; then
|
||||||
echo "Installing docker-compose binary..."
|
echo "Downloading docker-compose..."
|
||||||
curl -fsSL "https://github.com/docker/compose/releases/download/v2.32.4/docker-compose-linux-x86_64" \
|
curl -fsSL "https://github.com/docker/compose/releases/download/v2.32.4/docker-compose-linux-x86_64" \
|
||||||
-o .ci-bin/docker-compose
|
-o .ci-bin/docker-compose
|
||||||
chmod +x .ci-bin/docker-compose
|
chmod +x .ci-bin/docker-compose
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export PATH="$PWD/.ci-bin:$PATH"
|
.ci-bin/docker version
|
||||||
docker version
|
.ci-bin/docker-compose version
|
||||||
docker-compose version
|
'''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Compose smoke') {
|
||||||
|
steps {
|
||||||
|
sh '''
|
||||||
|
set -euo pipefail
|
||||||
sed '/exclude_from_hc:/d' docker-compose.yml > dist/docker-compose.coolify.yml
|
sed '/exclude_from_hc:/d' docker-compose.yml > dist/docker-compose.coolify.yml
|
||||||
docker-compose -f dist/docker-compose.coolify.yml config -q
|
.ci-bin/docker-compose -f dist/docker-compose.coolify.yml config -q
|
||||||
|
|
||||||
VERSION="$(grep -E '^ERPNEXT_VERSION=' example.env | cut -d= -f2)"
|
VERSION="$(grep -E '^ERPNEXT_VERSION=' example.env | cut -d= -f2)"
|
||||||
docker pull "frappe/erpnext:${VERSION}"
|
.ci-bin/docker pull "frappe/erpnext:${VERSION}"
|
||||||
echo "frappe/erpnext:${VERSION} OK"
|
echo "frappe/erpnext:${VERSION} OK"
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue