Add Artifactory Publishing (#1886)

To prepare for the Bintray shutdown add publication to the hyperledger's
artifactory instance to the build.

Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
pull/1888/head
Danno Ferrin 4 years ago committed by GitHub
parent 5ac3415a2e
commit c05fd11467
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      .circleci/config.yml
  2. 1
      CHANGELOG.md
  3. 67
      build.gradle

@ -230,7 +230,7 @@ jobs:
- run:
name: Publish
command: |
./gradlew --no-daemon bintrayUpload
./gradlew --no-daemon artifactoryPublish bintrayUpload
publishDocker:
executor: besu_executor_med

@ -4,6 +4,7 @@
### Additions and Improvements
* Added `besu_transaction_pool_transactions` to the reported metrics, counting the mempool size [\#1869](https://github.com/hyperledger/besu/pull/1869)
* Distributions and maven artifacts have been moved off of bintray [\#1886](https://github.com/hyperledger/besu/pull/1886)
### Bug Fixes

@ -23,10 +23,12 @@ plugins {
id 'com.diffplug.spotless' version '5.9.0'
id 'com.github.ben-manes.versions' version '0.36.0'
id 'com.github.hierynomus.license' version '0.15.0'
id 'com.jfrog.artifactory' version '4.20.0'
id 'com.jfrog.bintray' version '1.8.5'
id 'io.spring.dependency-management' version '1.0.10.RELEASE'
id 'me.champeau.gradle.jmh' version '0.5.0' apply false
id 'net.ltgt.errorprone' version '1.3.0'
id 'maven-publish'
}
if (!JavaVersion.current().java11Compatible) {
@ -122,7 +124,7 @@ allprojects {
repositories {
jcenter()
mavenCentral()
mavenLocal()
maven { url "https://hyperledger.jfrog.io/hyperledger/besu-maven" }
maven { url "https://hyperledger-org.bintray.com/besu-repo" }
maven { url "https://consensys.bintray.com/pegasys-repo" }
maven { url "https://consensys.bintray.com/consensys" }
@ -281,7 +283,7 @@ task checkMavenCoordinateCollisions {
doLast {
def coordinates = [:]
getAllprojects().forEach {
if (it.properties.containsKey('publishing')) {
if (it.properties.containsKey('publishing') && it.jar?.enabled) {
def coordinate = it.publishing?.publications[0].coordinates
if (coordinates.containsKey(coordinate)) {
throw new GradleException("Duplicate maven coordinates detected, ${coordinate} is used by " +
@ -365,6 +367,7 @@ subprojects {
}
if (sourceSetIsPopulated("main") || sourceSetIsPopulated("testSupport")) {
apply plugin: 'com.jfrog.artifactory'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'maven-publish'
@ -416,6 +419,27 @@ subprojects {
pkg = bintrayPackage
}
def artifactoryUser = project.hasProperty('artifactoryUser') ? project.property('artifactoryUser') : System.getenv('ARTIFACTORY_USER')
def artifactoryKey = project.hasProperty('artifactoryApiKey') ? project.property('artifactoryApiKey') : System.getenv('ARTIFACTORY_KEY')
def artifactoryRepo = System.getenv('ARTIFACTORY_REPO') ?: 'besu-maven'
def artifactoryOrg = System.getenv('ARTIFACTORY_ORG') ?: 'hyperledger'
artifactory {
contextUrl = "https://hyperledger.jfrog.io/${artifactoryOrg}"
publish {
repository {
repoKey = "${artifactoryRepo}"
username = artifactoryUser
password = artifactoryKey
}
defaults {
publications('mavenJava')
publishArtifacts = true
publishPom = true
}
}
}
}
tasks.withType(Test) {
@ -549,6 +573,45 @@ distZip {
}
}
publishing {
publications {
distArtifactory(MavenPublication) {
groupId (version.contains('SNAPSHOT') ? 'SNAPSHOT' : '.')
version = project.version
artifactId = 'besu-distribution'
artifact("$buildDir/distributions/besu-${project.version}.zip")
artifact("$buildDir/distributions/besu-${project.version}.tar.gz") {
extension = 'tar.gz'
}
}
}
}
def artifactoryUser = project.hasProperty('artifactoryUser') ? project.property('artifactoryUser') : System.getenv('ARTIFACTORY_USER')
def artifactoryKey = project.hasProperty('artifactoryApiKey') ? project.property('artifactoryApiKey') : System.getenv('ARTIFACTORY_KEY')
def artifactoryOrg = System.getenv('ARTIFACTORY_ORG') ?: 'hyperledger'
artifactory {
contextUrl = "https://hyperledger.jfrog.io/${artifactoryOrg}"
publish {
repository {
repoKey = "besu-binaries"
username = artifactoryUser
password = artifactoryKey
}
defaults {
publications('distArtifactory')
publishArtifacts = true
publishPom = false
}
}
}
artifactoryPublish {
dependsOn distTar
dependsOn distZip
}
def dockerVariants = [
"openjdk-11",
"graalvm",

Loading…
Cancel
Save