diff --git a/pipelines/Cloud/Apps-Backend/avroid-service-lib.groovy b/pipelines/Cloud/Apps-Backend/avroid-service-lib.groovy index 0454d7c..d3999b3 100644 --- a/pipelines/Cloud/Apps-Backend/avroid-service-lib.groovy +++ b/pipelines/Cloud/Apps-Backend/avroid-service-lib.groovy @@ -27,67 +27,66 @@ slaveTemplates = new PodTemplates(this, env.JENKINS_DOCKER_REGISTRY, ["${env.JEN slaveTemplates.jnlp { slaveTemplates.poetry { - slaveTemplates.docker { - slaveTemplates.git { - node(POD_LABEL){ - try { - container('poetry'){ - stage('Download sources') { - gitVars = git.clone([urlRepo: "${env.JENKINS_GIT_REPOSITORY_SSH_URL}/${repoPath}", - branch: git.getBranch()]) - } - - stage('prepare app'){ - sh 'make setup' - } - - stage('build lib'){ - sh 'make build' - } + slaveTemplates.git { + node(POD_LABEL){ + try { + container('poetry'){ + stage('Download sources') { + gitVars = git.clone([urlRepo: "${env.JENKINS_GIT_REPOSITORY_SSH_URL}/${repoPath}", + branch: git.getBranch()]) } - container('git'){ - stage('push lib to nexus'){ - author = git.getAuthor(commit: gitVars.GIT_COMMIT) + stage('prepare app'){ + sh 'make setup' + } - if (env.TAG_NAME) { - print "Upload from tag ${env.TAG_NAME}" - currentBuild.description = env.TAG_NAME + stage('build lib'){ + sh 'make build' + } + } - dir(localArtifactDir){ - String artifacts = sh( - script: """#!/bin/sh - ls *.whl *.gz - """, - returnStdout: true).trim() + container('git'){ + stage('push lib to nexus'){ + author = git.getAuthor(commit: gitVars.GIT_COMMIT) - artifacts.split().each { artifact -> - nexus.uploadPypiArtifact( - artifact: "${artifact}", - repository: nexusRepoName - ) - } + if (env.TAG_NAME) { + print "Upload from tag ${env.TAG_NAME}" + currentBuild.description = env.TAG_NAME + + dir(localArtifactDir){ + String artifacts = sh( + script: """#!/bin/sh + ls *.whl *.gz + """, + returnStdout: true).trim() + artifacts.split().each { artifact -> + println "Upload artifact ${artifact}" + + nexus.uploadPypiArtifact( + artifact: "${artifact}", + repository: nexusRepoName + ) } } } } - } catch (err) { - errorMessage = err.getMessage() - - println 'ERROR: ' + errorMessage - - currentBuild.result = 'FAILURE' - - String emailSubject = "${currentBuild.currentResult}. " + - "Pipeline task: ${currentBuild.fullDisplayName}" - Notifications.email( - script: this, - subject: emailSubject, - errorString: errorMessage, - recipientProviders: [], - to: author.email - ) } + } catch (err) { + errorMessage = err.getMessage() + + println 'ERROR: ' + errorMessage + + currentBuild.result = 'FAILURE' + + String emailSubject = "${currentBuild.currentResult}. " + + "Pipeline task: ${currentBuild.fullDisplayName}" + Notifications.email( + script: this, + subject: emailSubject, + errorString: errorMessage, + recipientProviders: [], + to: author.email + ) } } }