Skip to content

Commit 70bdd19

Browse files
mbwhitejt-nti
authored andcommitted
Add in publishing of the nightly master branch drivers
Signed-off-by: Matthew B White <[email protected]>
1 parent 6200fb4 commit 70bdd19

File tree

6 files changed

+72
-14
lines changed

6 files changed

+72
-14
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
/build/
99
build/*
1010

11+
.env
12+
1113
.gradle
1214
/build/
1315
out/

RELEASING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,7 @@ When the release has completed and the _Staging Repositories_ list is empty, the
5757
- Update test, sample, and docs files to match the new version
5858

5959
See the [Bump version to 2.2.1](https://github.com/hyperledger/fabric-chaincode-java/pull/127) pull request for an example. It should include almost all the files changed to prepare for the release, except for the release notes and changelog which do not need updating.
60+
61+
## Interim Build Publishing
62+
63+
tbc

build.gradle

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
apply plugin: 'idea'
88
apply plugin: 'eclipse-wtp'
99
version = '2.3.1'
10+
11+
if (properties.containsKey('NIGHTLY')) {
12+
version = version + '.dev.' + getDate()
13+
}
14+
1015
allprojects {
1116
repositories {
1217
mavenCentral()
@@ -57,3 +62,10 @@ subprojects {
5762
task printVersionName() {
5863
println rootProject.version
5964
}
65+
66+
67+
def getDate() {
68+
def date = new Date()
69+
def formattedDate = date.format('yyyyMMdd')
70+
return formattedDate
71+
}

ci/azure-pipelines.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ schedules:
1414
branches:
1515
include:
1616
- master
17-
always: true
1817

1918
trigger:
2019
branches:
@@ -205,3 +204,23 @@ stages:
205204
KEYRING_FILE: $(keyring.secureFilePath)
206205
OSSRH_USER: $(OSSRH-User)
207206
OSSRH_PASSWORD: $(OSSRH-Password)
207+
208+
#
209+
- stage: Publish_tag_nightly
210+
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags'))
211+
jobs:
212+
- job: jar_publish
213+
steps:
214+
- template: templates/build-data.yml
215+
- task: DownloadSecureFile@1
216+
name: keyring
217+
inputs:
218+
secureFile: secring.gpg
219+
- script: |
220+
./gradlew -PNIGHTLY=true -Psigning.keyId=${SIGNING_ID} -Psigning.password=${SIGNING_PASSWORD} -Psigning.secretKeyRingFile=${KEYRING_FILE} -PartifactoryUsername=${ARTIFACTORY_USER} -PartifactoryhPassword=${ARTIFACTORY_PASSWORD} uploadArchives
221+
env:
222+
SIGNING_ID: $(JAR-Signing-Id)
223+
SIGNING_PASSWORD: $(JAR-Signing-Password)
224+
KEYRING_FILE: $(keyring.secureFilePath)
225+
ARTIFACTORY_USER: $(ARTIFACTORY-User)
226+
ARTIFACTORY_PASSWORD: $(ARTIFACTORY-Password)

fabric-chaincode-protos/build.gradle

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,16 +142,28 @@ uploadArchives {
142142
mavenDeployer {
143143
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
144144

145-
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
146-
authentication(userName: project.findProperty('ossrhUsername'), password: project.findProperty('ossrhPassword'))
147-
}
145+
if (properties.containsKey('NIGHTLY')) {
146+
logger.info("++++++++++++++++++++++++++++++ Running Nightly")
147+
repository(url: "https://hyperledger-fabric.jfrog.io/artifactory/fabric-maven") {
148+
authentication(userName: project.findProperty('artifactoryUsername'), password: project.findProperty('artifactoryPassword'))
149+
}
150+
151+
snapshotRepository(url: "https://hyperledger-fabric.jfrog.io/artifactory/fabric-maven") {
152+
authentication(userName: project.findProperty('artifactoryUsername'), password: project.findProperty('artifactoryPassword'))
153+
}
154+
} else {
155+
logger.info("Running Release")
156+
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
157+
authentication(userName: project.findProperty('ossrhUsername'), password: project.findProperty('ossrhPassword'))
158+
}
148159

149-
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
150-
authentication(userName: project.findProperty('ossrhUsername'), password: project.findProperty('ossrhPassword'))
160+
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
161+
authentication(userName: project.findProperty('ossrhUsername'), password: project.findProperty('ossrhPassword'))
162+
}
151163
}
152164

153165
pom.project {
154-
name 'JavaChaincodeProtobuf'
166+
name '++++++++++++++++++++++++++++++++++++++JavaChaincodeProtobuf'
155167
packaging 'jar'
156168
description 'Hyperldger Fabric Java chaincode protobuf files'
157169
url 'http://www.hyperledger.org/'

fabric-chaincode-shim/build.gradle

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ checkstyleTest {
3535
source ='src/test/java'
3636
}
3737

38-
39-
4038
check.dependsOn dependencyCheckAnalyze
4139

4240
tasks.withType(org.gradle.api.tasks.testing.Test) {
@@ -257,12 +255,23 @@ uploadArchives {
257255
mavenDeployer {
258256
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
259257

260-
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
261-
authentication(userName: project.findProperty('ossrhUsername'), password: project.findProperty('ossrhPassword'))
262-
}
258+
if (properties.containsKey('NIGHTLY')) {
259+
260+
repository(url: "https://hyperledger-fabric.jfrog.io/artifactory/fabric-maven") {
261+
authentication(userName: project.findProperty('artifactoryUsername'), password: project.findProperty('artifactoryPassword'))
262+
}
263263

264-
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
265-
authentication(userName: project.findProperty('ossrhUsername'), password: project.findProperty('ossrhPassword'))
264+
snapshotRepository(url: "https://hyperledger-fabric.jfrog.io/artifactory/fabric-maven") {
265+
authentication(userName: project.findProperty('artifactoryUsername'), password: project.findProperty('artifactoryPassword'))
266+
}
267+
} else {
268+
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
269+
authentication(userName: project.findProperty('ossrhUsername'), password: project.findProperty('ossrhPassword'))
270+
}
271+
272+
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
273+
authentication(userName: project.findProperty('ossrhUsername'), password: project.findProperty('ossrhPassword'))
274+
}
266275
}
267276

268277
pom.project {

0 commit comments

Comments
 (0)