mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-26 00:45:50 +00:00
script
This commit is contained in:
parent
c79e562a06
commit
e13f6a4a06
1 changed files with 29 additions and 8 deletions
37
Jenkinsfile
vendored
37
Jenkinsfile
vendored
|
@ -7,13 +7,13 @@ pipeline {
|
||||||
// string(name: 'NEXUS_REPOSITORY', defaultValue: "maven-nexus-repo")
|
// string(name: 'NEXUS_REPOSITORY', defaultValue: "maven-nexus-repo")
|
||||||
// string(name: 'NEXUS_CREDENTIAL_ID', defaultValue: "e6072e08-87bc-481e-9e4a-55d506546356")
|
// string(name: 'NEXUS_CREDENTIAL_ID', defaultValue: "e6072e08-87bc-481e-9e4a-55d506546356")
|
||||||
// }
|
// }
|
||||||
// environment {
|
environment {
|
||||||
// NEXUS_VERSION = "nexus3"
|
NEXUS_VERSION = "nexus3"
|
||||||
// NEXUS_PROTOCOL = "http"
|
NEXUS_PROTOCOL = "http"
|
||||||
// NEXUS_URL = "172.19.0.3:8081"
|
NEXUS_URL = "172.19.0.3:8081"
|
||||||
// NEXUS_REPOSITORY = "maven-nexus-repo"
|
NEXUS_REPOSITORY = "maven-nexus-repo"
|
||||||
// NEXUS_CREDENTIAL_ID = "e6072e08-87bc-481e-9e4a-55d506546356"
|
NEXUS_CREDENTIAL_ID = "e6072e08-87bc-481e-9e4a-55d506546356"
|
||||||
// }
|
}
|
||||||
stages {
|
stages {
|
||||||
stage('pull') {
|
stage('pull') {
|
||||||
steps {
|
steps {
|
||||||
|
@ -50,8 +50,29 @@ pipeline {
|
||||||
// }
|
// }
|
||||||
stage('push') {
|
stage('push') {
|
||||||
steps {
|
steps {
|
||||||
nexusPublisher nexusInstanceId: 'maven-nexus-repo', nexusRepositoryId: 'maven-releases', packages: [[$class: 'MavenPackage', mavenAssetList: [[classifier: '', extension: '.jar', filePath: '/target/']], mavenCoordinate: [artifactId: 'spring-petclinic', groupId: 'org.springframework.samples', packaging: 'pom', version: '2.4.2']]]
|
pom = readMavenPom file: "pom.xml";
|
||||||
|
filesByGlob = findFiles(glob: "target/*.${pom.packaging}");
|
||||||
|
echo "${filesByGlob[0].name} ${filesByGlob[0].path} ${filesByGlob[0].directory} ${filesByGlob[0].length} ${filesByGlob[0].lastModified}"
|
||||||
|
artifactPath = filesByGlob[0].path;
|
||||||
|
artifactExists = fileExists artifactPath;
|
||||||
|
//
|
||||||
|
// if(artifactExists) {
|
||||||
|
// echo "*** File: ${artifactPath}, group: ${pom.groupId}, packaging: ${pom.packaging}, version ${pom.version}";
|
||||||
|
|
||||||
|
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";
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue