This commit is contained in:
dxin
2025-11-01 14:50:29 +08:00
parent 4053c70dcc
commit 1df8723f48
8 changed files with 34 additions and 23 deletions

View File

@@ -181,10 +181,12 @@ pipeline {
def imageId = parts[0]
def tag = parts[1]
// 跳过 latest
if (tag != "latest") {
if (tag == "<none>") {
echo "删除旧镜像(无标签): ${imageId}"
sh(returnStatus: true, script: "docker rmi -f ${imageId}")
} else if (tag != "latest") {
echo "删除旧镜像: ${imagePrefix}:${tag}"
sh "docker rmi -f ${imagePrefix}:${tag} || true"
sh(returnStatus: true, script: "docker rmi -f ${imagePrefix}:${tag}")
}
}
} else {

View File

@@ -181,10 +181,12 @@ pipeline {
def imageId = parts[0]
def tag = parts[1]
// 跳过 latest
if (tag != "latest") {
if (tag == "<none>") {
echo "删除旧镜像(无标签): ${imageId}"
sh(returnStatus: true, script: "docker rmi -f ${imageId}")
} else if (tag != "latest") {
echo "删除旧镜像: ${imagePrefix}:${tag}"
sh "docker rmi -f ${imagePrefix}:${tag} || true"
sh(returnStatus: true, script: "docker rmi -f ${imagePrefix}:${tag}")
}
}
} else {

View File

@@ -181,10 +181,12 @@ pipeline {
def imageId = parts[0]
def tag = parts[1]
// 跳过 latest
if (tag != "latest") {
if (tag == "<none>") {
echo "删除旧镜像(无标签): ${imageId}"
sh(returnStatus: true, script: "docker rmi -f ${imageId}")
} else if (tag != "latest") {
echo "删除旧镜像: ${imagePrefix}:${tag}"
sh "docker rmi -f ${imagePrefix}:${tag} || true"
sh(returnStatus: true, script: "docker rmi -f ${imagePrefix}:${tag}")
}
}
} else {

View File

@@ -183,10 +183,12 @@ pipeline {
def imageId = parts[0]
def tag = parts[1]
// 跳过 latest
if (tag != "latest") {
if (tag == "<none>") {
echo "删除旧镜像(无标签): ${imageId}"
sh(returnStatus: true, script: "docker rmi -f ${imageId}")
} else if (tag != "latest") {
echo "删除旧镜像: ${imagePrefix}:${tag}"
sh "docker rmi -f ${imagePrefix}:${tag} || true"
sh(returnStatus: true, script: "docker rmi -f ${imagePrefix}:${tag}")
}
}
} else {

View File

@@ -194,10 +194,12 @@ pipeline {
def imageId = parts[0]
def tag = parts[1]
// 跳过 latest
if (tag != "latest") {
if (tag == "<none>") {
echo "删除旧镜像(无标签): ${imageId}"
sh(returnStatus: true, script: "docker rmi -f ${imageId}")
} else if (tag != "latest") {
echo "删除旧镜像: ${imagePrefix}:${tag}"
sh "docker rmi -f ${imagePrefix}:${tag} || true"
sh(returnStatus: true, script: "docker rmi -f ${imagePrefix}:${tag}")
}
}
} else {

View File

@@ -164,10 +164,12 @@ pipeline {
def imageId = parts[0]
def tag = parts[1]
// 跳过 latest
if (tag != "latest") {
if (tag == "<none>") {
echo "删除旧镜像(无标签): ${imageId}"
sh(returnStatus: true, script: "docker rmi -f ${imageId}")
} else if (tag != "latest") {
echo "删除旧镜像: ${imagePrefix}:${tag}"
sh "docker rmi -f ${imagePrefix}:${tag} || true"
sh(returnStatus: true, script: "docker rmi -f ${imagePrefix}:${tag}")
}
}
} else {

View File

@@ -38,8 +38,8 @@ spec:
type: DirectoryOrCreate
containers:
- name: test-flymoon-agent # 容器名称
image: uswccr.ccs.tencentyun.com/lessietest/flymoon-agent:v0.0.2 # 容器镜像
imagePullPolicy: IfNotPresent # 镜像拉取策略 ,有则不拉
image: uswccr.ccs.tencentyun.com/lessietest/flymoon-agent:v0.0.5 # 容器镜像
imagePullPolicy: Always # 镜像拉取策略 ,有则不拉
env:
- name: POD_NAME
valueFrom:

View File

@@ -38,8 +38,8 @@ spec:
type: DirectoryOrCreate
containers:
- name: test-flymoon-payment # 容器名称
image: uswccr.ccs.tencentyun.com/lessietest/flymoon-payment:v0.0.3 # 容器镜像
imagePullPolicy: IfNotPresent # 镜像拉取策略 ,有则不拉
image: uswccr.ccs.tencentyun.com/lessietest/flymoon-payment:v0.0.7 # 容器镜像
imagePullPolicy: Always # 镜像拉取策略,总是拉取
env:
- name: POD_NAME
valueFrom:
@@ -88,4 +88,3 @@ spec:
port: 8090 # ClusterIP 内部端口
targetPort: 8090 # 容器端口
nodePort: 30809 # 节点对外端口(30000-32767)