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 ->
|
||||
echo "Deploying ${service}..."
|
||||
|
||||
// 使用明确的命令格式
|
||||
sh """
|
||||
docker compose -f docker-compose.core.yml pull ${service}
|
||||
docker compose -f docker-compose.core.yml up -d ${service}
|
||||
cd /opt/aiot-platform-cloud
|
||||
/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