Jenkins file edit
Some checks failed
test/timeline-frontend/pipeline/head There was a failure building this commit

This commit is contained in:
2025-12-30 13:35:18 +08:00
parent 8952ee0aa8
commit c609b6b504

36
Jenkinsfile vendored
View File

@@ -159,7 +159,7 @@ pipeline {
steps {
script {
// 创建或更新docker-compose文件
def composeContent = getComposeFileContent()
def composeContent = getComposeFileContent('dev')
writeFile file: 'docker-compose.yml', text: composeContent
// 拉取最新镜像
@@ -236,23 +236,23 @@ def deployToEnvironmentWithCompose(String env) {
def nginxConfContent = readFile('nginx.conf')
// 根据部署环境替换后端服务地址
switch(env) {
case 'dev':
// 开发环境使用特定的后端服务地址
nginxConfContent = nginxConfContent.replaceAll('host.docker.internal:33333', 'dev-backend-service:33333')
break
case 'staging':
// 预发布环境使用特定的后端服务地址
nginxConfContent = nginxConfContent.replaceAll('host.docker.internal:33333', 'staging-backend-service:33333')
break
case 'prod':
// 生产环境使用特定的后端服务地址
nginxConfContent = nginxConfContent.replaceAll('host.docker.internal:33333', 'prod-backend-service:33333')
break
default:
// 默认使用生产环境后端服务
nginxConfContent = nginxConfContent.replaceAll('host.docker.internal:33333', 'prod-backend-service:33333')
}
// switch(env) {
// case 'dev':
// // 开发环境使用特定的后端服务地址
// nginxConfContent = nginxConfContent.replaceAll('host.docker.internal:33333', 'dev-backend-service:33333')
// break
// case 'staging':
// // 预发布环境使用特定的后端服务地址
// nginxConfContent = nginxConfContent.replaceAll('host.docker.internal:33333', 'staging-backend-service:33333')
// break
// case 'prod':
// // 生产环境使用特定的后端服务地址
// nginxConfContent = nginxConfContent.replaceAll('host.docker.internal:33333', 'prod-backend-service:33333')
// break
// default:
// // 默认使用生产环境后端服务
// nginxConfContent = nginxConfContent.replaceAll('host.docker.internal:33333', 'prod-backend-service:33333')
// }
// 写入环境特定的 nginx 配置
writeFile file: "nginx-${env}.conf", text: nginxConfContent