diff --git a/rc-auth/pipeline-dev b/rc-auth/pipeline-dev index 4fad3858..c97061f9 100644 --- a/rc-auth/pipeline-dev +++ b/rc-auth/pipeline-dev @@ -17,6 +17,7 @@ pipeline { JAR_NAME = "rc-auth-*.jar" ALIYUN_REGISTRY = "registry.cn-hangzhou.aliyuncs.com/public_mirror_images" IMAGE_REP_TAG = "" + NERDCTL = "nerdctl --address /run/containerd/containerd.sock" DOCKER_FILE = "rc-auth/Dockerfile-dev" DOCKER_DIR = "rc-auth" K8S_NAMESPACE = "azizi" @@ -49,15 +50,15 @@ pipeline { usernameVariable: 'ALIYUN_USER', passwordVariable: 'ALIYUN_PASS' )]) { - sh 'echo $ALIYUN_PASS | nerdctl login --username $ALIYUN_USER --password-stdin registry.cn-hangzhou.aliyuncs.com' + sh 'echo $ALIYUN_PASS | $NERDCTL login --username $ALIYUN_USER --password-stdin registry.cn-hangzhou.aliyuncs.com' } - sh "nerdctl build --build-arg SERVICE_VERSION=${BUILD_IMAGE} -f ${DOCKER_FILE} -t ${IMAGE_REP_TAG} ${DOCKER_DIR}" + sh "${NERDCTL} build --build-arg SERVICE_VERSION=${BUILD_IMAGE} -f ${DOCKER_FILE} -t ${IMAGE_REP_TAG} ${DOCKER_DIR}" } } stage('Upload image') { steps { - sh "nerdctl push ${IMAGE_REP_TAG}" - sh "nerdctl rmi -f ${IMAGE_REP_TAG}" + sh "${NERDCTL} push ${IMAGE_REP_TAG}" + sh "${NERDCTL} rmi -f ${IMAGE_REP_TAG}" } } stage('Apply') {