From 9cc4619610b585c374de446a55f97317bc44dd20 Mon Sep 17 00:00:00 2001 From: VSAzima Date: Fri, 23 Apr 2021 12:57:39 +0400 Subject: [PATCH] back to origins with envs --- Jenkinsfile | 43 +++++++++++++++++++++++++++++++------------ 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f4a0da69b..e1aa3cfdd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -36,6 +36,18 @@ pipeline { checkout scm } } +// stage('Publish') { +// def pom = readMavenPom file: 'pom.xml' +// nexusPublisher nexusInstanceId: 'your-nexus-instance-id', \ +// nexusRepositoryId: ${env.NEXUS_REPOSITORY}, \ +// packages: [[$class: 'MavenPackage', \ +// mavenAssetList: [[classifier: '', extension: '', filePath: "target/${pom.artifactId}-${pom.version}.${pom.packaging}"], \ +// [classifier: 'sources', extension: '', filePath: "target/${pom.artifactId}-${pom.version}-sources.${pom.packaging}"]], \ +// mavenCoordinate: [artifactId: "${pom.artifactId}", \ +// groupId: "${pom.groupId}", \ +// packaging: "${pom.packaging}", \ +// version: "${pom.version}-${env.BUILD_NUMBER}"]]] +// } stage('push') { steps { script { @@ -50,18 +62,25 @@ pipeline { // if(artifactExists) { // echo "*** File: ${artifactPath}, group: ${pom.groupId}, packaging: ${pom.packaging}, version ${pom.version}"; - nexusArtifactUploader(${params.NEXUS_VERSION}, ${params.NEXUS_PROTOCOL}, ${params.NEXUS_URL}, pom.groupId, pom.version, ${params.NEXUS_REPOSITORY}, ${params.NEXUS_CREDENTIAL_ID}, - artifacts: [ - [artifactId: pom.artifactId, - classifier: '', - file: artifactPath, - type: pom.packaging], - [artifactId: pom.artifactId, - classifier: '', - file: "pom.xml", - type: "pom"] - ] - ); + nexusArtifactUploader + nexusVersion: ${env.NEXUS_VERSION}, + protocol: ${env.NEXUS_PROTOCOL}, + nexusUrl: ${env.NEXUS_URL}, + groupId: pom.groupId, + version: pom.version, + repository: ${env.NEXUS_REPOSITORY}, + credentialsId: ${env.NEXUS_CREDENTIAL_ID}, + artifacts: [ + [artifactId: pom.artifactId, + classifier: '', + file: artifactPath, + type: pom.packaging], + [artifactId: pom.artifactId, + classifier: '', + file: "pom.xml", + type: "pom"] + ] + ; // } else { // error "*** File: ${artifactPath}, could not be found"; // }