Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
212 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
apply plugin: "com.jfrog.artifactory" | ||
|
||
def isSnapshot = version?.matches(/^.*[.-]BUILD-SNAPSHOT$/) | ||
|
||
artifactory { | ||
contextUrl = 'https://repo.spring.io' | ||
publish { | ||
repository { | ||
repoKey = isSnapshot ? 'libs-snapshot-local' : 'libs-release-local' | ||
if(project.hasProperty('artifactoryUsername')) { | ||
username = artifactoryUsername | ||
password = artifactoryPassword | ||
} | ||
} | ||
} | ||
} | ||
|
||
artifactoryPublish { | ||
publishConfigs 'archives' | ||
publishIvy false | ||
properties = [ | ||
'bintray.package': "${project.group}:spring-security", | ||
'bintray.version': "${project.version}" | ||
] | ||
} | ||
|
||
artifactory { | ||
publish { | ||
defaults { | ||
publishConfigs('archives') | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
def isSnapshot = version?.matches(/^.*[.-]BUILD-SNAPSHOT$/) | ||
|
||
task deployArtifacts { | ||
group = 'Deploy tasks' | ||
description = "Deploys the artifacts to either Artifactory or Maven Central" | ||
if(isSnapshot) { | ||
dependsOn "artifactoryPublish" | ||
} else { | ||
dependsOn "uploadArchives" | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
apply plugin: 'org.hidetake.ssh' | ||
|
||
project.ssh.settings { | ||
knownHosts = allowAnyHosts | ||
} | ||
|
||
project.remotes { | ||
docs { | ||
role 'docs' | ||
host = 'docs.af.pivotal.io' | ||
user = project.findProperty('deployDocsSshUsername') | ||
if(project.hasProperty('deployDocsSshKeyPath')) { | ||
identity = project.file(project.findProperty('deployDocsSshKeyPath')) | ||
} | ||
if(project.hasProperty('deployDocsSshPassphrase')) { | ||
passphrase = project.findProperty('deployDocsSshPassphrase') | ||
} | ||
} | ||
} | ||
|
||
project.task('deployDocs') { | ||
dependsOn 'docsZip' | ||
doFirst { | ||
project.ssh.run { | ||
session(project.remotes.docs) { | ||
def now = System.currentTimeMillis() | ||
def name = project.rootProject.name | ||
def version = project.rootProject.version | ||
def tempPath = "/tmp/${name}-${now}-docs".replaceAll(' ', '_') | ||
execute "mkdir -p $tempPath" | ||
|
||
project.tasks.docsZip.outputs.each { o -> | ||
put from: o.files, into: tempPath | ||
} | ||
|
||
execute "unzip $tempPath/*.zip -d $tempPath" | ||
|
||
def extractPath = "/var/www/domains/springsource.org/www/htdocs/autorepo/docs/${name}/${version}/" | ||
|
||
execute "rm -rf $extractPath" | ||
execute "mkdir -p $extractPath" | ||
execute "mv $tempPath/* $extractPath" | ||
} | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
apply plugin: 'org.hidetake.ssh' | ||
|
||
project.ssh.settings { | ||
knownHosts = allowAnyHosts | ||
} | ||
|
||
project.remotes { | ||
docs { | ||
role 'docs' | ||
host = 'docs.af.pivotal.io' | ||
user = project.findProperty('deployDocsSshUsername') | ||
if(project.hasProperty('deployDocsSshKeyPath')) { | ||
identity = project.file(project.findProperty('deployDocsSshKeyPath')) | ||
} | ||
if(project.hasProperty('deployDocsSshPassphrase')) { | ||
passphrase = project.findProperty('deployDocsSshPassphrase') | ||
} | ||
} | ||
} | ||
|
||
project.task('deploySchema') { | ||
dependsOn 'schemaZip' | ||
doFirst { | ||
project.ssh.run { | ||
session(project.remotes.docs) { | ||
def now = System.currentTimeMillis() | ||
def name = project.rootProject.name | ||
def version = project.rootProject.version | ||
def tempPath = "/tmp/${name}-${now}-schema".replaceAll(' ', '_') | ||
|
||
execute "mkdir -p $tempPath" | ||
|
||
project.tasks.schemaZip.outputs.each { o -> | ||
println "Putting $o.files" | ||
put from: o.files, into: tempPath | ||
} | ||
|
||
execute "unzip $tempPath/*.zip -d $tempPath" | ||
|
||
def extractPath = "/var/www/domains/springsource.org/www/htdocs/autorepo/schema/${name}/${version}/" | ||
|
||
execute "rm -rf $extractPath" | ||
execute "mkdir -p $extractPath" | ||
execute "rm -f $tempPath*.zip" | ||
execute "rm -rf $extractPath*" | ||
execute "mv $tempPath/* $extractPath" | ||
} | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
def isSnapshot = version?.matches(/^.*[.-]BUILD-SNAPSHOT$/) | ||
def isRelease = !isSnapshot | ||
|
||
task finalizeDeployArtifacts { | ||
} | ||
|
||
if (isRelease && project.hasProperty("ossrhUsername")) { | ||
project.ext.nexusUsername = project.ossrhUsername | ||
project.ext.nexusPassword = project.ossrhPassword | ||
project.getPluginManager().apply("io.codearte.nexus-staging") | ||
finalizeDeployArtifacts.dependsOn project.tasks.closeAndReleaseRepository | ||
project.nexusStaging.packageGroup = 'org.springframework' | ||
} |
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
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
def isSnapshot = version?.matches(/^.*[.-]BUILD-SNAPSHOT$/) | ||
def isRelease = !isSnapshot | ||
|
||
if(project.hasProperty("signing.keyId") && isRelease) { | ||
apply plugin: "signing" | ||
sign(project) | ||
} | ||
|
||
if(project.hasProperty('ossrhUsername')) { | ||
uploadArchives { | ||
repositories { | ||
mavenDeployer { | ||
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { | ||
authentication(userName: project.ossrhUsername, password: project.ossrhPassword) | ||
} | ||
|
||
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { | ||
authentication(userName: project.ossrhUsername, password: project.ossrhPassword) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
def sign(Project project) { | ||
project.install { | ||
repositories { | ||
mavenDeployer { | ||
beforeDeployment { MavenDeployment deployment -> project.signing.signPom(deployment) } | ||
} | ||
} | ||
} | ||
|
||
project.uploadArchives { | ||
repositories { | ||
mavenDeployer { | ||
beforeDeployment { MavenDeployment deployment -> project.signing.signPom(deployment) } | ||
} | ||
} | ||
} | ||
|
||
project.signing { | ||
required { project.gradle.taskGraph.hasTask("uploadArchives") } | ||
sign project.configurations.archives | ||
} | ||
} |