2016-11-20 2 views
0

젠킨스 파이프 라인에서 Nexus Artifact 업로드를 사용하여 이펙트를 Nexus에 업로드 파이프 라인에서이 코드를 사용하여 배포하면 하나의 이슈를 배포하는 데 완벽하게 작동합니다. 하지만 내가 어떻게 multipe 아티팩트를 배포 할 수 있습니다 다큐먼트에여러 이슈를 넥서스에 배포하는 방법은 무엇입니까?

Stage 'Nexus Deploy' 
    nexusArtifactUploader 
     artifactId: 'com.example.project', 
     file: 'server/jetty-project/target/jetty-project-0.0.1-SNAPSHOT.war', 
     groupId: 'test-javaproject', 
     type:'war', 
     nexusPassword: 'admin123', 
     nexusUrl: 'XX.XX.XX.XX:8080/nexus', 
     nexusUser: 'admin', 
     nexusVersion: 'nexus3', 
     protocol: 'http', 
     repository: 'maven-snapshots', 
     version: '0.0.1-SNAPSHOT' 

을 그것이 그

freeStyleJob('NexusArtifactUploaderJob') { 
    steps { 
     nexusArtifactUploader { 
     nexusVersion('nexus2') 
     protocol('http') 
     nexusUrl('localhost:8080/nexus') 
     groupId('sp.sd') 
     version('2.4') 
     repository('NexusArtifactUploader') 
     credentialsId('44620c50-1589-4617-a677-7563985e46e1') 
     artifact { 
      artifactId('nexus-artifact-uploader') 
      type('jar') 
      classifier('debug') 
      file('nexus-artifact-uploader.jar') 
     } 
     artifact { 
      artifactId('nexus-artifact-uploader') 
      type('hpi') 
      classifier('debug') 
      file('nexus-artifact-uploader.hpi') 
     } 
     } 
    } 
} 

같은 여러 아티팩트를 배포 할 가능성이 있다고하지만이 jenkinsfile에 그 만드는 방법을 궁금하네요?

답변

2

Jenkinsfile의 nexusArtifactUploader 구문은 다음과 같습니다.

nexusArtifactUploader artifacts: [ 
    [artifactId: 'nexus-artifact-uploader', classifier: 'debug', file: 'nexus-artifact-uploader.jar', type: 'jar'], 
    [artifactId: 'nexus-artifact-uploader', classifier: 'debug', file: 'nexus-artifact-uploader.hpi', type: 'hpi'] 
], 
credentialsId: '44620c50-1589-4617-a677-7563985e46e1', 
groupId: 'sp.sd', 
nexusUrl: 'localhost:8080/nexus', 
nexusVersion: 'nexus2', 
protocol: 'http', 
repository: 'NexusArtifactUploader', 
version: '2.4' 

파이프 라인 코드 생성기에서 위 구문을 생성 할 수 있습니다.