+
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user