fix(ci): require docker-capable Jenkins agent with preflight checks

This commit is contained in:
2026-03-06 13:41:14 +00:00
parent d525cf2589
commit 4a334b8812
2 changed files with 30 additions and 1 deletions

23
Jenkinsfile vendored
View File

@@ -1,5 +1,7 @@
pipeline {
agent any
// Build + deploy stages require Docker CLI/daemon access on the Jenkins node.
// Ensure this label maps to an agent with Docker installed and usable.
agent { label 'docker' }
environment {
REGISTRY_IMAGE = "plesk-agency-portal"
@@ -8,6 +10,25 @@ pipeline {
}
stages {
stage('Preflight') {
steps {
sh '''
set -euo pipefail
if ! command -v docker >/dev/null 2>&1; then
echo "Docker CLI is not available on this Jenkins agent."
echo "Run this pipeline on a Docker-capable node (label: docker) or install Docker on the current agent."
exit 1
fi
if ! docker version >/dev/null 2>&1; then
echo "Docker is installed but not usable by Jenkins (daemon/socket/permissions issue)."
exit 1
fi
'''
}
}
stage('Checkout') {
steps {
checkout scm