hotfix/DO-0/remove_docker (!100)
Co-authored-by: Rustam Tagaev <rustam.tagaev@avroid.tech> Reviewed-on: https://git.avroid.tech/DevOps/jenkins-pipelines/pulls/100
This commit is contained in:
@@ -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
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user