+1
This commit is contained in:
29
jenkins/构建镜像配置/docker.conf
Normal file
29
jenkins/构建镜像配置/docker.conf
Normal file
@@ -0,0 +1,29 @@
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
stages {
|
||||
stage('拉取镜像') {
|
||||
steps {
|
||||
// 登录镜像仓库
|
||||
withCredentials([usernamePassword(credentialsId: 'dxin_img_hub_auth', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {
|
||||
sh '''
|
||||
echo "$REGISTRY_PWD" | docker login ${REGISTRY} -u ${REGISTRY_USER} --password-stdin
|
||||
'''
|
||||
}
|
||||
// 拉取镜像
|
||||
sh "docker pull uswccr.ccs.tencentyun.com/lessietest/lessie-sourcing-agents:${IMAGE_TAG}"
|
||||
}
|
||||
}
|
||||
stage('展示镜像Label信息') {
|
||||
steps {
|
||||
sh "docker inspect --format='{{json .Config.Labels}}' uswccr.ccs.tencentyun.com/lessie.s2/lessie-sourcing-agents:${IMAGE_TAG}"
|
||||
}
|
||||
}
|
||||
stage('部署镜像') {
|
||||
steps {
|
||||
// 这里可以添加具体的部署逻辑,例如使用docker-compose或kubectl进行部署
|
||||
echo "这是部署步骤"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user