Skip to content
This repository has been archived by the owner on May 10, 2021. It is now read-only.

Commit

Permalink
Bump to 0.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
igormoochnick committed Apr 16, 2014
1 parent 54fd525 commit 0b84a25
Show file tree
Hide file tree
Showing 8 changed files with 103 additions and 8 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,23 @@ Here's a high level overview of what's available:
run command1
- maven3:
goals: -B clean
mavenName: maven-name # Optional
wrappers:
- timestamp: true
- ansicolor: true
- artifactory:
url: 'https://url.com/path'
artifactory-name: 'key'
target-repo: gems-local
release-repo: release
snapshot-repo: snapshot
publish: 'pkg/*.gem'
publish-build-info: true
publish-build-info: true # Optional
- maven3artifactory:
url: https://artifactory.com/artifactory
artifactory-name: name
release-repo: release
snapshot-repo: snapshot
publish-build-info: true # Optional
- inject_env_var: |
VAR1 = value_1
VAR2 = value_2
Expand Down
2 changes: 1 addition & 1 deletion lib/jenkins_pipeline_builder/builders.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def self.build_multijob_builder(params, xml)

def self.build_maven3(params, xml)
xml.send('org.jfrog.hudson.maven3.Maven3Builder') {
xml.mavenName 'tools-maven-3.0.3'
xml.mavenName params[:mavenName] || 'tools-maven-3.0.3'
xml.rootPom params[:rootPom]
xml.goals params[:goals]
xml.mavenOpts params[:options]
Expand Down
3 changes: 2 additions & 1 deletion lib/jenkins_pipeline_builder/generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ def initialize(args, client)
artifactory: Wrappers.method(:publish_to_artifactory),
rvm: Wrappers.method(:run_with_rvm),
inject_env_var: Wrappers.method(:inject_env_vars),
inject_passwords: Wrappers.method(:inject_passwords)
inject_passwords: Wrappers.method(:inject_passwords),
maven3artifactory: Wrappers.method(:artifactory_maven3_configurator)
},
method:
lambda { |registry, params, n_xml| @module_registry.run_registry_on_path('//buildWrappers', registry, params, n_xml) }
Expand Down
2 changes: 1 addition & 1 deletion lib/jenkins_pipeline_builder/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@
#

module JenkinsPipelineBuilder
VERSION = "0.1.6"
VERSION = "0.2.1"
end
46 changes: 44 additions & 2 deletions lib/jenkins_pipeline_builder/wrappers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ def self.publish_to_artifactory(wrapper, xml)
xml.details {
xml.artifactoryUrl wrapper[:url]
xml.artifactoryName wrapper[:'artifactory-name']
xml.repositoryKey wrapper[:'target-repo']
xml.snapshotsRepositoryKey wrapper[:'target-repo']
xml.repositoryKey wrapper[:'release-repo']
xml.snapshotsRepositoryKey wrapper.fetch(:'snapshot-repo', wrapper[:'release-repo'])
}
xml.deployPattern wrapper[:publish]
xml.resolvePattern
Expand All @@ -87,5 +87,47 @@ def self.publish_to_artifactory(wrapper, xml)
xml.discardBuildArtifacts true
}
end

def self.artifactory_maven3_configurator(wrapper, xml)
xml.send('org.jfrog.hudson.maven3.ArtifactoryMaven3Configurator') { # plugin="[email protected]"
xml.details {
xml.artifactoryUrl wrapper[:url]
xml.artifactoryName wrapper[:'artifactory-name']
xml.repositoryKey wrapper[:'release-repo']
xml.snapshotsRepositoryKey wrapper.fetch(:'snapshot-repo', wrapper[:'release-repo'])
}
xml.deployArtifacts wrapper.fetch(:'deploy', true)
xml.artifactDeploymentPatterns {
xml.includePatterns
xml.excludePatterns
}
xml.includeEnvVars false
xml.deployBuildInfo wrapper.fetch(:'publish-build-info', true)
xml.envVarsPatterns {
xml.includePatterns
xml.excludePatterns '*password*,*secret*'
}
xml.runChecks false
xml.violationRecipients
xml.includePublishArtifacts false
xml.scopes
xml.licenseAutoDiscovery true
xml.disableLicenseAutoDiscovery false
xml.discardOldBuilds false
xml.discardBuildArtifacts true
xml.matrixParams
xml.enableIssueTrackerIntegration false
xml.aggregateBuildIssues false
xml.blackDuckRunChecks false
xml.blackDuckAppName
xml.blackDuckAppVersion
xml.blackDuckReportRecipients
xml.blackDuckScopes
xml.blackDuckIncludePublishedArtifacts false
xml.autoCreateMissingComponentRequests true
xml.autoDiscardStaleComponentRequests true
xml.filterExcludedArtifactsFromBuild false
}
end
end
end
39 changes: 39 additions & 0 deletions spec/unit_tests/fixtures/files/Job-Build-Maven.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,44 @@
</publishers>
<buildWrappers>
<hudson.plugins.timestamper.TimestamperBuildWrapper/>
<org.jfrog.hudson.maven3.ArtifactoryMaven3Configurator>
<details>
<artifactoryUrl>https://artifactory.com/artifactory</artifactoryUrl>
<artifactoryName>name</artifactoryName>
<repositoryKey>release</repositoryKey>
<snapshotsRepositoryKey>snapshot</snapshotsRepositoryKey>
</details>
<deployArtifacts>true</deployArtifacts>
<artifactDeploymentPatterns>
<includePatterns></includePatterns>
<excludePatterns></excludePatterns>
</artifactDeploymentPatterns>
<includeEnvVars>false</includeEnvVars>
<deployBuildInfo>true</deployBuildInfo>
<envVarsPatterns>
<includePatterns></includePatterns>
<excludePatterns>*password*,*secret*</excludePatterns>
</envVarsPatterns>
<runChecks>false</runChecks>
<violationRecipients></violationRecipients>
<includePublishArtifacts>false</includePublishArtifacts>
<scopes></scopes>
<licenseAutoDiscovery>true</licenseAutoDiscovery>
<disableLicenseAutoDiscovery>false</disableLicenseAutoDiscovery>
<discardOldBuilds>false</discardOldBuilds>
<discardBuildArtifacts>true</discardBuildArtifacts>
<matrixParams></matrixParams>
<enableIssueTrackerIntegration>false</enableIssueTrackerIntegration>
<aggregateBuildIssues>false</aggregateBuildIssues>
<blackDuckRunChecks>false</blackDuckRunChecks>
<blackDuckAppName></blackDuckAppName>
<blackDuckAppVersion></blackDuckAppVersion>
<blackDuckReportRecipients></blackDuckReportRecipients>
<blackDuckScopes></blackDuckScopes>
<blackDuckIncludePublishedArtifacts>false</blackDuckIncludePublishedArtifacts>
<autoCreateMissingComponentRequests>true</autoCreateMissingComponentRequests>
<autoDiscardStaleComponentRequests>true</autoDiscardStaleComponentRequests>
<filterExcludedArtifactsFromBuild>false</filterExcludedArtifactsFromBuild>
</org.jfrog.hudson.maven3.ArtifactoryMaven3Configurator>
</buildWrappers>
</project>
5 changes: 5 additions & 0 deletions spec/unit_tests/fixtures/files/Job-Build-Maven.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,8 @@
- params: VM_NAME=${VM_NAME}
wrappers:
- timestamp: true
- maven3artifactory:
url: https://artifactory.com/artifactory
artifactory-name: name
release-repo: release
snapshot-repo: snapshot
2 changes: 1 addition & 1 deletion spec/unit_tests/fixtures/files/Job-Gem-Build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
- artifactory:
url: 'https://artifactory.com/artifactory'
artifactory-name: 'key'
target-repo: gems-local
release-repo: gems-local
publish: 'pkg/*.gem'
publish-build-info: true
- inject_env_var: >
Expand Down

0 comments on commit 0b84a25

Please sign in to comment.