-
Notifications
You must be signed in to change notification settings - Fork 396
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #162 from stchar/feature/artifactory
Update to use repo.jenkinci.org artifactory
- Loading branch information
Showing
4 changed files
with
68 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import com.lesfurets.gradle.* | ||
|
||
plugins { | ||
id "io.codearte.nexus-staging" version "0.8.0" | ||
id "com.jfrog.artifactory" version "4.11.0" | ||
id 'groovy' | ||
id 'maven-publish' | ||
id 'java' | ||
id 'jacoco' | ||
} | ||
|
||
apply plugin: 'groovy' | ||
apply plugin: 'maven' | ||
apply plugin: 'signing' | ||
apply plugin: 'jacoco' | ||
|
||
repositories { | ||
mavenCentral() | ||
mavenCentral() | ||
jcenter() | ||
} | ||
|
||
group = "com.lesfurets" | ||
|
@@ -60,14 +60,6 @@ task sourcesJar(type: Jar) { | |
from sourceSets.main.allSource | ||
} | ||
|
||
artifacts { | ||
archives javadocJar, sourcesJar | ||
} | ||
|
||
signing { | ||
sign configurations.archives | ||
} | ||
|
||
// Copy the resolved grapes configuration to a maven2 like directory structure (no transitive dependencies) | ||
task copyGrapesDependencies(type: CopyDependenciesToMavenTreeTask) { | ||
configuration = configurations.grape | ||
|
@@ -94,85 +86,91 @@ jacocoTestReport { | |
} | ||
} | ||
|
||
uploadArchives { | ||
repositories { | ||
mavenDeployer { | ||
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } | ||
|
||
def repo = project.hasProperty('repository') ? | ||
project.repository : | ||
"https://oss.sonatype.org/service/local/staging/deploy/maven2/" | ||
repository(url: repo) { | ||
authentication(userName: ossrhUsername, password: ossrhPassword) | ||
} | ||
|
||
def snapRepo = project.hasProperty('snapshotRepository') ? | ||
project.snapshotRepository : | ||
"https://oss.sonatype.org/content/repositories/snapshots/" | ||
snapshotRepository(url: snapRepo) { | ||
authentication(userName: ossrhUsername, password: ossrhPassword) | ||
} | ||
|
||
pom.project { | ||
name "$project.group:$project.archivesBaseName" | ||
packaging 'jar' | ||
description 'Jenkins Pipeline Unit testing framework' | ||
url 'https://github.com/lesfurets/JenkinsPipelineUnit' | ||
publishing { | ||
publications { | ||
maven(MavenPublication) { | ||
from components.java | ||
artifact tasks.sourcesJar | ||
artifact tasks.javadocJar | ||
pom { | ||
artifactId = "$project.archivesBaseName" | ||
packaging = 'jar' | ||
description = 'Jenkins Pipeline Unit testing framework' | ||
url = 'https://github.com/jenkinsci/JenkinsPipelineUnit' | ||
|
||
scm { | ||
url 'https://github.com/lesfurets/JenkinsPipelineUnit' | ||
connection 'scm:git:git://github.com/lesfurets/JenkinsPipelineUnit.git' | ||
developerConnection 'scm:git:[email protected]/lesfurets/JenkinsPipelineUnit.git' | ||
url = 'https://github.com/jenkinsci/JenkinsPipelineUnit' | ||
connection = 'scm:git:git://github.com/jenkinsci/JenkinsPipelineUnit.git' | ||
developerConnection = 'scm:git:[email protected]/jenkinsci/JenkinsPipelineUnit.git' | ||
} | ||
|
||
licenses { | ||
license { | ||
name 'MIT License' | ||
url 'http://www.opensource.org/licenses/mit-license.php' | ||
distribution 'repo' | ||
name = 'MIT License' | ||
url = 'http://www.opensource.org/licenses/mit-license.php' | ||
distribution = 'repo' | ||
} | ||
} | ||
|
||
developers { | ||
developer { | ||
id 'ozangunalp' | ||
name 'Ozan Gunalp' | ||
email '[email protected]' | ||
url 'https://github.com/ozangunalp' | ||
organization 'lesfurets.com' | ||
organizationUrl 'https://github.com/lesfurets' | ||
id = 'ozangunalp' | ||
name = 'Ozan Gunalp' | ||
email = '[email protected]' | ||
url = 'https://github.com/ozangunalp' | ||
organization = 'lesfurets.com' | ||
organizationUrl = 'https://github.com/lesfurets' | ||
} | ||
developer { | ||
id 'EQuincerot' | ||
name 'Emmanuel Quincerot' | ||
url 'https://github.com/EQuincerot' | ||
organization 'lesfurets.com' | ||
organizationUrl 'https://github.com/lesfurets' | ||
id = 'EQuincerot' | ||
name = 'Emmanuel Quincerot' | ||
url = 'https://github.com/EQuincerot' | ||
organization = 'lesfurets.com' | ||
organizationUrl = 'https://github.com/lesfurets' | ||
} | ||
developer { | ||
name 'Thomas du Boÿs' | ||
url 'https://github.com/Skool' | ||
id 'Skool' | ||
organization 'lesfurets.com' | ||
organizationUrl 'https://github.com/lesfurets' | ||
name = 'Thomas du Boÿs' | ||
url = 'https://github.com/Skool' | ||
id = 'Skool' | ||
organization = 'lesfurets.com' | ||
organizationUrl = 'https://github.com/lesfurets' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
nexusStaging { | ||
delayBetweenRetriesInMillis = 5000 | ||
artifactory { | ||
contextUrl = 'https://repo.jenkins-ci.org' | ||
publish { | ||
repository { | ||
repoKey = project.version.toString().endsWith('-SNAPSHOT') ? 'snapshots' : 'releases' | ||
username = "${artifactory_user}" // The publisher user name | ||
password = "${artifactory_password}" // The publisher password | ||
} | ||
defaults { | ||
// Reference to Gradle publications defined in the build script. | ||
// This is how we tell the Artifactory Plugin which artifacts should be | ||
// published to Artifactory. | ||
publications('maven') | ||
publishArtifacts = true | ||
// Properties to be attached to the published artifacts. | ||
properties = ['qa.level': 'basic', 'dev.team' : 'core'] | ||
// Publish generated POM files to Artifactory (true by default) | ||
publishPom = true | ||
} | ||
} | ||
} | ||
|
||
// Deploy tasks | ||
closeAndReleaseRepository.mustRunAfter(uploadArchives) | ||
closeRepository.enabled = !project.version.toString().endsWith('-SNAPSHOT') | ||
releaseRepository.enabled = !project.version.toString().endsWith('-SNAPSHOT') | ||
//closeAndReleaseRepository.mustRunAfter(uploadArtifacts) | ||
//closeRepository.enabled = !project.version.toString().endsWith('-SNAPSHOT') | ||
//releaseRepository.enabled = !project.version.toString().endsWith('-SNAPSHOT') | ||
|
||
task verify(dependsOn: build) | ||
task deploy(dependsOn: [build, uploadArchives, closeAndReleaseRepository]) | ||
task deploy(dependsOn: [build, artifactoryDeploy]) | ||
|
||
// Release commits and tag | ||
task writeVersion(type: SetVersionTask) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# dummy properties | ||
ossrhUsername=deployment | ||
ossrhPassword=deployment123 | ||
artifactory_user=deployment | ||
artifactory_password=deployment123 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters