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/goUpload.git" stage('Run shell') { git branch: 'develop', credentialsId: 'gitea-builder', url: "${CODE_ADDR}" container('golang-builder-1-22') { sh''' go env -w GOPROXY=https://goproxy.cn,direct go env -w GO111MODULE=on CGO_ENABLED=0 go build -ldflags "-extldflags -static " -a -v -o app.exe main.go tar -cvf out.tar *.exe configFiles/ ''' } archiveArtifacts artifacts: 'out.tar', followSymlinks: false buildName "${IMAGE_NAME_SHORT}:${IMAGE_VERSION}" buildDescription "${IMAGE_NAME}:${IMAGE_VERSION}" } } }