fix: 修复 Jenkins 中 docker compose 命令执行问题
- 使用 docker 的绝对路径 /usr/bin/docker - 切换到项目目录执行命令 - 确保命令在 Jenkins shell 环境中正确执行
This commit is contained in:
6
Jenkinsfile
vendored
6
Jenkinsfile
vendored
@@ -183,9 +183,11 @@ pipeline {
|
|||||||
services.each { service ->
|
services.each { service ->
|
||||||
echo "Deploying ${service}..."
|
echo "Deploying ${service}..."
|
||||||
|
|
||||||
|
// 使用明确的命令格式
|
||||||
sh """
|
sh """
|
||||||
docker compose -f docker-compose.core.yml pull ${service}
|
cd /opt/aiot-platform-cloud
|
||||||
docker compose -f docker-compose.core.yml up -d ${service}
|
/usr/bin/docker compose -f docker-compose.core.yml pull ${service}
|
||||||
|
/usr/bin/docker compose -f docker-compose.core.yml up -d ${service}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
// 等待服务健康检查
|
// 等待服务健康检查
|
||||||
|
|||||||
Reference in New Issue
Block a user