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.jnlp {
|
||||||
slaveTemplates.poetry {
|
slaveTemplates.poetry {
|
||||||
slaveTemplates.docker {
|
slaveTemplates.git {
|
||||||
slaveTemplates.git {
|
node(POD_LABEL){
|
||||||
node(POD_LABEL){
|
try {
|
||||||
try {
|
container('poetry'){
|
||||||
container('poetry'){
|
stage('Download sources') {
|
||||||
stage('Download sources') {
|
gitVars = git.clone([urlRepo: "${env.JENKINS_GIT_REPOSITORY_SSH_URL}/${repoPath}",
|
||||||
gitVars = git.clone([urlRepo: "${env.JENKINS_GIT_REPOSITORY_SSH_URL}/${repoPath}",
|
branch: git.getBranch()])
|
||||||
branch: git.getBranch()])
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('prepare app'){
|
|
||||||
sh 'make setup'
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('build lib'){
|
|
||||||
sh 'make build'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
container('git'){
|
stage('prepare app'){
|
||||||
stage('push lib to nexus'){
|
sh 'make setup'
|
||||||
author = git.getAuthor(commit: gitVars.GIT_COMMIT)
|
}
|
||||||
|
|
||||||
if (env.TAG_NAME) {
|
stage('build lib'){
|
||||||
print "Upload from tag ${env.TAG_NAME}"
|
sh 'make build'
|
||||||
currentBuild.description = env.TAG_NAME
|
}
|
||||||
|
}
|
||||||
|
|
||||||
dir(localArtifactDir){
|
container('git'){
|
||||||
String artifacts = sh(
|
stage('push lib to nexus'){
|
||||||
script: """#!/bin/sh
|
author = git.getAuthor(commit: gitVars.GIT_COMMIT)
|
||||||
ls *.whl *.gz
|
|
||||||
""",
|
|
||||||
returnStdout: true).trim()
|
|
||||||
|
|
||||||
artifacts.split().each { artifact ->
|
if (env.TAG_NAME) {
|
||||||
nexus.uploadPypiArtifact(
|
print "Upload from tag ${env.TAG_NAME}"
|
||||||
artifact: "${artifact}",
|
currentBuild.description = env.TAG_NAME
|
||||||
repository: nexusRepoName
|
|
||||||
)
|
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