when else

This commit is contained in:
VSAzima 2021-04-22 20:25:09 +04:00
parent 368a5b13ab
commit 41e2d23120

6
Jenkinsfile vendored
View file

@ -27,15 +27,13 @@ pipeline {
stage('push') { stage('push') {
steps { steps {
script { script {
checkout scm;
pom = readMavenPom file: "pom.xml"; pom = readMavenPom file: "pom.xml";
filesByGlob = findFiles(glob: "target/*.${pom.packaging}"); filesByGlob = findFiles(glob: "target/*.${pom.packaging}");
echo "${filesByGlob[0].name} ${filesByGlob[0].path} ${filesByGlob[0].directory} ${filesByGlob[0].length} ${filesByGlob[0].lastModified}" echo "${filesByGlob[0].name} ${filesByGlob[0].path} ${filesByGlob[0].directory} ${filesByGlob[0].length} ${filesByGlob[0].lastModified}"
artifactPath = filesByGlob[0].path; artifactPath = filesByGlob[0].path;
artifactExists = fileExists artifactPath; artifactExists = fileExists artifactPath;
when(artifactExists) {
echo "*** File: ${artifactPath}, group: ${pom.groupId}, packaging: ${pom.packaging}, version ${pom.version}";
nexusArtifactUploader( nexusArtifactUploader(
nexusVersion: NEXUS_VERSION, nexusVersion: NEXUS_VERSION,
protocol: NEXUS_PROTOCOL, protocol: NEXUS_PROTOCOL,
@ -55,7 +53,7 @@ pipeline {
type: "pom"] type: "pom"]
] ]
); );
} }
} }
} }
} }