Skip to content

Commit 637f277

Browse files
authored
Migrate release process from Bintray to JFrog Artifactory (#297)
As of this commit, ParSeq releases will no longer be published to Bintray. Releases can be found at https://linkedin.jfrog.io
1 parent f012581 commit 637f277

9 files changed

Lines changed: 97 additions & 97 deletions

File tree

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ branches:
1616
- master
1717
- /^v\d+\.\d+\.\d+$/
1818

19-
# Set environment variables
19+
# Set environment variables (includes JFrog credentials)
2020
env:
2121
global:
22-
- secure: wFoTPsGqw71NOYpElIE/57QlZez6hSKunfrGadDpmFwoI1KU0VAzDulyui60UebenKgWOINzi/lvnj1A+js2DBe3ILyHSsXWlDQuFMiKKXyK83e5D0AENQvddrfwrGQ7lmfB3/7kOwhFZhVjda2NcYvehPt2i4ANsgSwljZdrtY=
23-
- secure: pGiCJ57NNj+kQzZk5RxkFsW7n6IbO/0e86igeKGiRIPMnfpVRIBqpgfO0ifv88LlBUAjaunsODCAOmc0DKKjp686KbA4Df2z10jiNqAQXJfgDu9Q1TprGK5n6TgnPv0Pygn9sE+Q2nOGZCLJEXHNAkS3POiRo5ifgCpzh3iB8og=
22+
- secure: "XqrufI5VyCfSmaSknN2LjbkWHbB8aO/j3ubahNYoKdd6k9AihFhYbLT419a+4AaQRc5L6VmDcSQyvbFk5ueffGqqSF/k+yrajw/Ghiti+3fSouS/2t09HTos4DiR1xU5xJNE8Mi9jQ+5XNCDzdl9hW5xhB3XzyeGbi9D/8M2Zl0lj5rz9pEevCIKS4G1jV5LJE2mbuQTjrrDI6iFlTKDg1K/R7TIxAL0FGfkM0hVn5p4Mg/s2+3o67k4LSK5qCGK8F6MpwMD6ShPPrAeRqoxiE6FHHqr7TR9uLNb7AeD5zR+YSWexw938VstQEFzsDs2Fr1v1y3Y6Uly+s3bel84TiZBn/Okfw47eo7pevTomoKROziJ9sgX+w33nWsHgRdtLvHBmeTbuPnjlpFgwbPKCK3ROu/Mlp6fvk/MbdH3K0apIZz89XPMPgM13+x0UyTY1t6Lhr0qEIU8CbpJh8M4B3krgxyTX8BNucCqTiPpUXCWmZL5+HK2f9Qx1XfvMnWWa1ckcc09gsYzvLVLUEqZvEiiUko+ldzWJ92zrb02xQsaIFLC6jewI2gEcolb7SYU3d/oadcC6jS7ehyEOkv21SvRPtUAjUZNDubRhqPtm6YHhzj+zvZ2NYHLVZUuheGO1X37YAeZmEnJFMx6i6f7mH+ZdP4MlaMcp1TRpRlK5vA="
23+
- secure: "sBC8EHpA09m96IXdFOciyeqCbBytnAfsxWikPIO//iztFznOSEqP5+ELorLDDUnNZgL0gqu1ps8YsC6ZuNdrXOTm4OIuUXlyfd9W3NDgoTeY6u7Dej7UGBolWKW3pZa0yePkpCiE9pz8nshTP9vFU7OqK6brtn83PoIEgk/lDBTx8GjKvU1epMC/vr+p5A0osvoSIvnZXQGGK6bwmXnXUQ6Xh4t6ai9NxPo55SSRKIAup5W0CGanS++EvcOG9y7YT2S01WDaff5W2yFgw8VzWPX7k6UICkYXZC2lDBgwnf/C2QeIkfjD2bpjWMkbHLXL8RpXZ9awtVRVZfeqag8Mg/TbQqiuybJO46qpcSruFyYT5zWK97uaLnlThkjo7BSUT6J/EY1AaKGgSEWZki5mOjr/64rkxcA66h7n7h/c4G5pINWF6sr3XBCuYAv+/QS7+0P5rE4Y2BkYsaihynRc8xDXbJrC9/tNN1BvN0Ewq9EuIN33uuaQ4JmZASknl2gXRfXCBNe2NlBtJTsItnqGBh/KqGLT1J75srqsX91FGlVzMSXGiAtbhsdqk+FfMJEssXQ4FcDm39y6M3gvjp2PNmIpuUHGfUwDrA+9bKEYg0ad+9fqgZMuBvwQDrqf1rHtaNaLKKBM5d9HCNJZrvKR3PYDG+te5ic3l+pxzE8Z45c="
2424

2525
# Publish a new version on tag push
2626
deploy:

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1+
v5.1.3
2+
------
3+
14
v5.1.2
25
------
6+
- Migrate the ParSeq release process from Bintray to JFrog Artifactory.
7+
- As of this version, Bintray will no longer host ParSeq releases.
8+
- Releases can be found on [LinkedIn's JFrog Artifactory instance](https://linkedin.jfrog.io/).
39

410
v5.1.1
511
------

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ParSeq
22

3-
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![Build Status](https://secure.travis-ci.org/linkedin/parseq.png?branch=master)](http://travis-ci.org/linkedin/parseq) [![Download](https://api.bintray.com/packages/linkedin/maven/parseq/images/download.svg)](https://bintray.com/linkedin/maven/parseq/_latestVersion)
3+
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![Build Status](https://secure.travis-ci.org/linkedin/parseq.png?branch=master)](http://travis-ci.org/linkedin/parseq)
44

55
ParSeq is a framework that makes it easier to write asynchronous code in Java.
66

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ buildscript {
33
jcenter()
44
}
55
dependencies {
6-
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
6+
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.21.0'
77
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.4'
88
}
99
}
@@ -142,9 +142,9 @@ task runTracevisServer (dependsOn:':parseq-tracevis-server:build') {
142142
subprojects { p ->
143143
if (!p.name.endsWith('examples')) {
144144
p.afterEvaluate {
145-
p.apply from: "$rootDir/gradle/maven.gradle"
145+
p.apply from: "$rootDir/gradle/publications.gradle"
146146
}
147-
p.apply from: "$rootDir/gradle/bintray.gradle"
147+
p.apply from: "$rootDir/gradle/jfrog.gradle"
148148
}
149149
}
150150

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
version=5.1.1
1+
version=5.1.2
22
group=com.linkedin.parseq
33
org.gradle.parallel=true

gradle/bintray.gradle

Lines changed: 0 additions & 71 deletions
This file was deleted.

gradle/jfrog.gradle

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/*
2+
Copyright (c) 2021 LinkedIn Corp.
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
Unless required by applicable law or agreed to in writing, software
8+
distributed under the License is distributed on an "AS IS" BASIS,
9+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
See the License for the specific language governing permissions and
11+
limitations under the License.
12+
*/
13+
14+
/**
15+
* The purpose of this script is to configure the following tasks for a sub-project:
16+
* - artifactoryPublish: publishes all artifacts for the "release" publication to JFrog; depends on...
17+
* - generatePomFileForReleasePublication: defined in publications.gradle
18+
* - assertArtifactsExist: defined in publications.gradle
19+
* - assertJFrogCredentialsExist: asserts that JFrog credentials are present as environment variables
20+
*/
21+
apply plugin: 'com.jfrog.artifactory' // https://www.jfrog.com/confluence/display/rtf/gradle+artifactory+plugin
22+
23+
final String jfrogUserEnv = 'JFROG_USER'
24+
final String jfrogKeyEnv = 'JFROG_KEY'
25+
26+
def jfrogUser = System.getenv(jfrogUserEnv)
27+
def jfrogKey = System.getenv(jfrogKeyEnv)
28+
29+
// Configure the "artifactoryPublish" task for the "release" publication.
30+
artifactory {
31+
contextUrl = 'https://linkedin.jfrog.io/artifactory'
32+
clientConfig.setIncludeEnvVars(false)
33+
34+
publish {
35+
repository {
36+
repoKey = 'parseq' // The Artifactory repository key to publish to
37+
username = jfrogUser // The publisher user name
38+
password = jfrogKey // The publisher password
39+
}
40+
41+
defaults {
42+
publications(publishing.publications.release)
43+
}
44+
}
45+
}
46+
47+
// Utility task to ensure that we aren't attempting a publish without providing JFrog credentials.
48+
task assertJFrogCredentialsExist() {
49+
doLast {
50+
if (!jfrogUser || !jfrogKey) {
51+
throw new GradleException(
52+
"Cannot perform JFrog upload. Missing '${jfrogUserEnv}' or '${jfrogKeyEnv}' environment variable. " +
53+
"These are set in the .travis.yml config file (if running in CI) or on the CLI (if running locally).")
54+
}
55+
}
56+
}
57+
58+
// Gather all assertion/publication/publish tasks into one task
59+
artifactoryPublish.dependsOn "assertArtifactsExist", assertJFrogCredentialsExist, "generatePomFileForReleasePublication"
Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@
1515
*/
1616

1717
/**
18-
* The purpose of this script is to configure the following tasks for a given sub-project:
19-
* - generatePomFileForReleasePublication: generates the "release" Maven publication (.pom), needed for bintrayUpload
18+
* The purpose of this script is to configure the publications (and create the associated tasks) for a sub-project.
19+
* Configures the following tasks:
20+
* - generatePomFileForReleasePublication: generates the "release" Maven publication (.pom), needed for publish
2021
* - publishReleasePublicationToMavenLocal: publishes the "release" publication to Maven local
22+
* - assertArtifactsExist: asserts that the required JAR artifacts are present
2123
*
2224
* This script should be applied after sub-projects are evaluated to ensure that sub-project archives have been
2325
* configured and extra properties have been set.
@@ -93,6 +95,16 @@ publishing {
9395
}
9496
}
9597

98+
// Utility task to assert that all to-be-published artifacts exist (allows us to safely decouple build and publish tasks)
99+
task assertArtifactsExist() {
100+
doLast {
101+
final Set<File> missingArtifacts = configurations.archives.allArtifacts.file.findAll { !it.exists() }
102+
if (missingArtifacts) {
103+
throw new GradleException("Cannot perform publish. The project likely hasn't been built. Missing artifacts ${missingArtifacts}")
104+
}
105+
}
106+
}
107+
96108
// TODO: remove once ivy publications are no longer required
97109
// Publish to project's local ivy repo
98110
uploadArchives {

scripts/travis/publish-tag.sh

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -50,26 +50,20 @@ if [ $? -ne 0 ]; then
5050
exit 1
5151
fi
5252

53-
# Build and publish to Bintray
54-
echo "All checks passed, attempting to publish ParSeq $VERSION to Bintray..."
55-
./gradlew -Prelease bintrayUpload
53+
# Publish to JFrog Artifactory
54+
echo "All checks passed, attempting to publish ParSeq $VERSION to JFrog Artifactory..."
55+
./gradlew -Prelease artifactoryPublish
5656

5757
if [ $? = 0 ]; then
58-
echo "Successfully published ParSeq $VERSION to Bintray."
58+
echo "Successfully published ParSeq $VERSION to JFrog Artifactory."
5959
else
60-
# Publish failed, so roll back the upload to ensure this version is completely wiped from the repo
61-
echo "Publish failed, wiping $VERSION from Bintray..."
62-
DELETE_VERSION_URL="https://api.bintray.com/packages/linkedin/maven/parseq/versions/${VERSION}"
63-
curl -X DELETE --user ${BINTRAY_USER}:${BINTRAY_KEY} --fail $DELETE_VERSION_URL
60+
# We used to roll back Bintray uploads on failure to publish, but it's not clear if this is needed for JFrog.
61+
# TODO: If "partial uploads" can occur for JFrog, then here we would roll back the upload via the JFrog REST API.
62+
# We did this before using: curl -X DELETE --user ${BINTRAY_USER}:${BINTRAY_KEY} --fail $DELETE_VERSION_URL
6463

65-
if [ $? = 0 ]; then
66-
echo "Successfully rolled $VERSION back."
67-
echo 'Please retry the upload by restarting this Travis job.'
68-
else
69-
echo "Failed to roll back $VERSION, please manually delete this version from Bintray."
70-
echo "See: https://bintray.com/linkedin/maven/parseq/$VERSION"
71-
echo 'Once this version is deleted, please retry the upload by restarting this Travis job.'
72-
fi
64+
echo 'Failed to publish to JFrog Artifactory.'
65+
echo "You can check https://linkedin.jfrog.io/ui/repos/tree/General/parseq to ensure that $VERSION is not present."
66+
echo 'Please retry the upload by restarting this Travis job.'
7367

7468
exit 1
7569
fi

0 commit comments

Comments
 (0)