1+
2+ @Library (' pipelinex@development' ) _
3+ import com.iguazio.pipelinex.DockerRepo
4+
5+
16label = " ${ UUID.randomUUID().toString()} "
27BUILD_FOLDER = " /home/jenkins/go"
38git_project = " prometheus"
@@ -10,52 +15,24 @@ podTemplate(label: "${git_project}-${label}", inheritFrom: "jnlp-docker") {
1015 withCredentials([
1116 string(credentialsId : git_deploy_user_token, variable : ' GIT_TOKEN' )
1217 ]) {
13- def TAG_VERSION
14- def DOCKER_TAG_VERSION
15- pipelinex = library(identifier : ' pipelinex@development' , retriever : modernSCM(
16- [$class : ' GitSCMSource' ,
17- credentialsId : git_deploy_user_private_key,
18- remote : " git@github.com:iguazio/pipelinex.git" ])). com. iguazio. pipelinex
19- multi_credentials = [pipelinex.DockerRepo . ARTIFACTORY_IGUAZIO , pipelinex.DockerRepo . DOCKER_HUB , pipelinex.DockerRepo . QUAY_IO , pipelinex.DockerRepo . GCR_IO ]
2018
21- common. notify_slack {
22- stage(' get tag data' ) {
23- container(' jnlp' ) {
24- TAG_VERSION = github. get_tag_version(TAG_NAME )
25- DOCKER_TAG_VERSION = github. get_docker_tag_version(TAG_NAME )
26-
27- echo " $TAG_VERSION "
28- echo " $DOCKER_TAG_VERSION "
29- }
30- }
19+ multi_credentials = [DockerRepo . ARTIFACTORY_IGUAZIO , DockerRepo . DOCKER_HUB , DockerRepo . QUAY_IO , DockerRepo . GCR_IO ]
3120
32- if (github. check_tag_expiration(git_project, git_project_user, TAG_VERSION , GIT_TOKEN )) {
33- stage(' prepare sources' ) {
34- container(' jnlp' ) {
35- dir(" ${ BUILD_FOLDER} /src/github.com/${ git_project} /${ git_project} " ) {
36- git(changelog : false , credentialsId : git_deploy_user_private_key, poll : false , url : " git@github.com:${ git_project_user} /${ git_project} .git" )
37- sh(" git checkout ${ TAG_VERSION} " )
38- }
39- }
40- }
21+ def github_client = new Githubc (git_project_user, git_project, GIT_TOKEN , env. TAG_NAME , this )
22+ github_client. releaseCi(true ) {
4123
24+ common. notify_slack {
4225 stage(" build ${ git_project} in dood" ) {
4326 container(' docker-cmd' ) {
44- dir(" ${ BUILD_FOLDER} /src/github.com/${ git_project } /${ git_project} " ) {
45- sh(" docker build . -f Dockerfile.multi --tag v3io-prom:${ DOCKER_TAG_VERSION } " )
27+ dir(" ${ BUILD_FOLDER} /src/github.com/${ git_project_user } /${ git_project} " ) {
28+ sh(" docker build . -f Dockerfile.multi --tag v3io-prom:${ github_client.tag.docker } " )
4629 }
4730 }
4831 }
4932
5033 stage(' push' ) {
5134 container(' docker-cmd' ) {
52- dockerx. images_push_multi_registries([" v3io-prom:${ DOCKER_TAG_VERSION} " ], multi_credentials)
53- }
54- }
55-
56- stage(' update release status' ) {
57- container(' jnlp' ) {
58- github. update_release_status(git_project, git_project_user, " ${ TAG_VERSION} " , GIT_TOKEN )
35+ dockerx. images_push_multi_registries([" v3io-prom:${ github_client.tag.docker} " ], multi_credentials)
5936 }
6037 }
6138 }
0 commit comments