|
|
@@ -125,11 +125,8 @@ pipeline {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- echo "处理MODULE_NAMESPACE_RESTFUL"
|
|
|
-// //把 module 名 从 sp-xxx 变成 xxx 也就是 项目 的 namespace
|
|
|
- //if (API_NAMESPACE_RESTFUL == "storlead-mail-api") {
|
|
|
- API_NAMESPACE_RESTFUL = "api"
|
|
|
- //}
|
|
|
+ // Spring context-path,须与 application-*.yml 中 server.servlet.context-path 一致
|
|
|
+ API_CONTEXT_PATH = "router/email"
|
|
|
echo "处理镜像推送"
|
|
|
}
|
|
|
}
|
|
|
@@ -232,11 +229,12 @@ pipeline {
|
|
|
sh """
|
|
|
echo '
|
|
|
FROM ${BASE_IMAGE}
|
|
|
+ RUN apt-get update && apt-get install -y --no-install-recommends curl && rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
COPY ${params.module}/target/${params.module}.jar app.jar
|
|
|
EXPOSE ${API_PORT}
|
|
|
EXPOSE ${API_REMOTE_DEBUG_PORT}
|
|
|
- HEALTHCHECK --interval=1m --timeout=10s CMD curl -f http://localhost:${API_PORT}/${API_NAMESPACE_RESTFUL}/actuator
|
|
|
+ HEALTHCHECK --interval=1m --timeout=10s CMD curl -fsS http://localhost:${API_PORT}/${API_CONTEXT_PATH}/actuator/health || exit 1
|
|
|
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom", "-Djava.awt.headless=true","-Dspring.profiles.active=${params.profile}", "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:${API_REMOTE_DEBUG_PORT}","-jar","/app.jar"]' > Dockerfile
|
|
|
docker build -t ${DOCKER_IMG_NAME} .
|
|
|
"""
|
|
|
@@ -308,7 +306,7 @@ services:
|
|
|
condition: on-failure
|
|
|
max_attempts: 3
|
|
|
healthcheck:
|
|
|
- test: ["CMD-SHELL", "wget -q -O /dev/null http://localhost:${API_PORT}/${API_NAMESPACE_RESTFUL}/actuator || exit 1"]
|
|
|
+ test: ["CMD-SHELL", "curl -fsS http://localhost:${API_PORT}/${API_CONTEXT_PATH}/actuator/health || exit 1"]
|
|
|
interval: 1m
|
|
|
timeout: 5s
|
|
|
retries: 3
|