back to origins with envs

This commit is contained in:
VSAzima 2021-04-23 12:57:39 +04:00
parent 1b42cf9a76
commit 9cc4619610

43
Jenkinsfile vendored
View file

@ -36,6 +36,18 @@ pipeline {
checkout scm 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') { stage('push') {
steps { steps {
script { script {
@ -50,18 +62,25 @@ pipeline {
// if(artifactExists) { // if(artifactExists) {
// echo "*** File: ${artifactPath}, group: ${pom.groupId}, packaging: ${pom.packaging}, version ${pom.version}"; // 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}, nexusArtifactUploader
artifacts: [ nexusVersion: ${env.NEXUS_VERSION},
[artifactId: pom.artifactId, protocol: ${env.NEXUS_PROTOCOL},
classifier: '', nexusUrl: ${env.NEXUS_URL},
file: artifactPath, groupId: pom.groupId,
type: pom.packaging], version: pom.version,
[artifactId: pom.artifactId, repository: ${env.NEXUS_REPOSITORY},
classifier: '', credentialsId: ${env.NEXUS_CREDENTIAL_ID},
file: "pom.xml", artifacts: [
type: "pom"] [artifactId: pom.artifactId,
] classifier: '',
); file: artifactPath,
type: pom.packaging],
[artifactId: pom.artifactId,
classifier: '',
file: "pom.xml",
type: "pom"]
]
;
// } else { // } else {
// error "*** File: ${artifactPath}, could not be found"; // error "*** File: ${artifactPath}, could not be found";
// } // }