From d7a51ab656de36400c33ecc8376b1f44bc63a9ba Mon Sep 17 00:00:00 2001 From: iris_cx Date: Thu, 15 Jun 2023 09:18:56 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'jenkinsfilenew=5Fweb'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jenkinsfilenew_web | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/jenkinsfilenew_web b/jenkinsfilenew_web index ea99169..0fc6880 100644 --- a/jenkinsfilenew_web +++ b/jenkinsfilenew_web @@ -1,21 +1,22 @@ -podTemplate { - node('pod-templ-jenkins-slave-common') { - - env.IMAGE_NAME = "${IOT_IMAGES_REGISTRY}/${IOT}/${JOB_NAME}" - env.IMAGE_NAME_SHORT = "${IOT}/${JOB_NAME}" - env.GIT_Add = "${GIT_ADDRESS}/free-sun/OperationalService/src/branch/dev/web" - - stage('Run shell') { - git credentialsId: 'gitea-builder', url: 'https://gitea.anxinyun.cn/free-sun/OperationalService.git' - - container('image-builder') { - sh''' - /kaniko/executor --context=${BUILD_WORKSPACE} --dockerfile=./web/Dockerfile --destination=${IMAGE_NAME}:${IMAGE_VERSION} --cache=false --cleanup - ''' - } - - buildName "${IMAGE_NAME_SHORT}:${IMAGE_VERSION}" - buildDescription "${IMAGE_NAME}:${IMAGE_VERSION}" - } - } -} +podTemplate { + node('pod-templ-jenkins-slave-common') { + + env.IMAGE_NAME = "${IOT_IMAGES_REGISTRY}/${IOT}/${JOB_NAME}" + env.IMAGE_NAME_SHORT = "${IOT}/${JOB_NAME}" + env.GIT_Add = "${GIT_ADDRESS}/free-sun/OperationalService/src/branch/dev/web" + + stage('Run shell') { + git credentialsId: 'gitea-builder', url: 'https://gitea.anxinyun.cn/free-sun/OperationalService.git' + + container('image-builder') { + sh''' + find . -depth -name '.svn' -type d -exec rm -rf {} + + /kaniko/executor --context=${BUILD_WORKSPACE} --dockerfile=./web/Dockerfile --destination=${IMAGE_NAME}:${IMAGE_VERSION} --cache=false --cleanup + ''' + } + + buildName "${IMAGE_NAME_SHORT}:${IMAGE_VERSION}" + buildDescription "${IMAGE_NAME}:${IMAGE_VERSION}" + } + } +}