From ea051b9e3770e2b31c90d2a524d6b1b360f2dc91 Mon Sep 17 00:00:00 2001 From: lucas Date: Fri, 27 Sep 2024 18:00:09 +0800 Subject: [PATCH] =?UTF-8?q?update=20builder=20=E7=94=A8=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/jenkinsfile_image_app | 62 ++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/build/jenkinsfile_image_app b/build/jenkinsfile_image_app index d66c032..fc362ce 100644 --- a/build/jenkinsfile_image_app +++ b/build/jenkinsfile_image_app @@ -1,40 +1,40 @@ podTemplate { node('pod-templ-jenkins-slave-golang') { - - env.IMAGE_NAME = "${IOT_IMAGES_REGISTRY}/${LOCAL}/${JOB_NAME}" - env.IMAGE_NAME_SHORT = "${LOCAL}/${JOB_NAME}" - env.CODE_ADDR = "${GIT_ADDRESS}/DevOps/et-go.git" - - stage('Run shell') { - git branch: 'dev', credentialsId: 'gitea-builder', url: "${CODE_ADDR}" - container('golang-builder-1-22') { - sh''' - git version - git config --global --add url."https://read-only:rEADoNLY7963@gitea.ngaiot.com/".insteadOf "https://gitea.ngaiot.com/" - unset GOPROXY - go env -w GOPROXY=https://goproxy.cn,direct - go env -w GO111MODULE=on - go env -w GOPRIVATE=gitea.ngaiot.com - go env -w GOSUMDB=sum.golang.org - go env + + env.IMAGE_NAME = "${IOT_IMAGES_REGISTRY}/${LOCAL}/${JOB_NAME}" + env.IMAGE_NAME_SHORT = "${LOCAL}/${JOB_NAME}" + env.CODE_ADDR = "${GIT_ADDRESS}/container/et-go.git" + + stage('Run shell') { + git branch: 'dev', credentialsId: 'gitea-builder', url: "${CODE_ADDR}" + container('golang-builder-1-22') { + sh''' + git version + git config --global --add url."https://builder:Fs7595!EAT@gitea.anxinyun.cn/".insteadOf "https://gitea.anxinyun.cn/" + unset GOPROXY + go env -w GOPROXY=https://goproxy.cn,direct + go env -w GO111MODULE=on + go env -w GOPRIVATE=gitea.ngaiot.com,gitea.anxinyun.cn + go env -w GOSUMDB=sum.golang.org + go env go build -a -v -o app.exe containerApp/main.go tar -cvf app.tar *.exe *.yaml - ''' - } + ''' + } - container('image-builder') { - sh''' - echo "当前目===" - pwd - ls - echo "========" - /kaniko/executor --context=${BUILD_WORKSPACE} --dockerfile=build/Dockerfile_app --destination=${IMAGE_NAME}:${IMAGE_VERSION} --cache=false --cleanup - ''' + container('image-builder') { + sh''' + echo "当前目===" + pwd + ls + echo "========" + /kaniko/executor --context=${BUILD_WORKSPACE} --dockerfile=build/Dockerfile_app --destination=${IMAGE_NAME}:${IMAGE_VERSION} --cache=false --cleanup + ''' } archiveArtifacts artifacts: 'app.tar', followSymlinks: false - buildName "${IMAGE_NAME_SHORT}:${IMAGE_VERSION}" - buildDescription "${IMAGE_NAME}:${IMAGE_VERSION}" - } - } + buildName "${IMAGE_NAME_SHORT}:${IMAGE_VERSION}" + buildDescription "${IMAGE_NAME}:${IMAGE_VERSION}" + } + } } \ No newline at end of file