You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
955 B
24 lines
955 B
2 weeks ago
|
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}"
|
||
|
}
|
||
|
}
|
||
|
}
|