Skip to content

Commit

Permalink
[LI-HOTFIX] CI: Publish artifacts to JFrog
Browse files Browse the repository at this point in the history
Squashed commits:
- [LI-HOTFIX] add Bintray support to LinkedIn Kafka Github
- [LI-HOTFIX] Migrate bintray publish to JFrog (apache#132)
- [LI-HOTFIX] Use JFrog Api key instead of password (apache#139)

TICKET = N/A
LI_DESCRIPTION = DEPENG-2065.
This is advised by dep engineering
EXIT_CRITERIA = When not using JFrog for publishing
  • Loading branch information
jonlee2 authored and lmr3796 committed Jun 2, 2022
1 parent 5a9078d commit 54fb2e3
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,8 @@ jobs:
# Set maxTestRetries for flaky tests. This is the setup in upstream Jenkinsfile
run: ./gradlew -PmaxTestRetries=3 cleanTest rat checkstyleMain checkstyleTest spotbugsMain spotbugsTest :clients:test :core:test --no-daemon -PxmlFindBugsReport=true -PtestLoggingEvents=started,passed,skipped,failed
- name: Upload archive
env:
JFROG_USERNAME: ${{ secrets.JFROG_USERNAME }}
JFROG_API_KEY: ${{ secrets.JFROG_API_KEY }}
run: |
./gradlew -Pversion=${{ env.RELEASE_VERSION }} :clients:uploadArchives :core:uploadArchives --no-daemon
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,20 +181,29 @@ The `eclipse` task has been configured to use `${project_dir}/build_eclipse` as
build directory (`${project_dir}/bin`) clashes with Kafka's scripts directory and we don't use Gradle's build directory
to avoid known issues with this configuration.

### Publishing the jar for all version of Scala and for all projects to maven ###
### Publishing the jar for all projects to maven ###
The recommended command is:

./gradlewAll publish
./gradlew -Pversion=<RELEASE_VERSION_NUMBER> publish

For backwards compatibility, the following also works:

./gradlewAll uploadArchives
./gradlew -Pversion=<RELEASE_VERSION_NUMBER> uploadArchives

Please note for this to work you should create/update `${GRADLE_USER_HOME}/gradle.properties` (typically, `~/.gradle/gradle.properties`) and assign the following variables
By default, this command will publish artifacts to a JFrog repository named "kafka" under an account specified by the `JFROG_USERNAME` environment variable;
and the `JFROG_API_KEY` environment variable is used for the API key for that account.

If you want to publish for all supported Scala version, change `./gradlew` to `./gradlewAll`.

If you want to override this to use a different maven repository, you should create/update `${GRADLE_USER_HOME}/gradle.properties` (typically, `~/.gradle/gradle.properties`)
and assign the following variables

mavenUrl=
mavenUsername=
mavenPassword=

Signing is disabled by default. If you need signing, please set the following variables in `gradle.properties` as well:

signing.keyId=
signing.password=
signing.secretKeyRingFile=
Expand Down
14 changes: 9 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,13 @@ ext {
skipSigning = project.hasProperty('skipSigning') && skipSigning.toBoolean()
shouldSign = !skipSigning && !version.endsWith("SNAPSHOT")

mavenUrl = project.hasProperty('mavenUrl') ? project.mavenUrl : ''
mavenUsername = project.hasProperty('mavenUsername') ? project.mavenUsername : ''
mavenPassword = project.hasProperty('mavenPassword') ? project.mavenPassword : ''
jfrogUsername = System.getenv('JFROG_USERNAME')
jfrogApiKey = System.getenv('JFROG_API_KEY')

// By default, publish to JFrog.
mavenUrl = project.hasProperty('mavenUrl') ? project.mavenUrl : jfrogRepoUrl
mavenUsername = project.hasProperty('mavenUsername') ? project.mavenUsername : jfrogUsername
mavenPassword = project.hasProperty('mavenPassword') ? project.mavenPassword : jfrogApiKey

userShowStandardStreams = project.hasProperty("showStandardStreams") ? showStandardStreams : null

Expand Down Expand Up @@ -260,8 +264,8 @@ subprojects {

artifactId = archivesBaseName
pom {
name = 'Apache Kafka'
url = 'https://kafka.apache.org'
name = 'LinkedIn fork of Apache Kafka'
url = 'https://github.com/linkedin/kafka'
licenses {
license {
name = 'The Apache License, Version 2.0'
Expand Down
11 changes: 8 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.

group=org.apache.kafka
# NOTE: When you change this version number, you should also make sure to update
# the version numbers in
group=com.linkedin.kafka

# NOTE: publishing artifacts requires a property named "version" to be set explicitly. For example,
# ./gradlew -Pversion=<version> publish
#
# You should also make sure to update the version numbers in
# - docs/js/templateData.js
# - tests/kafkatest/__init__.py
# - tests/kafkatest/version.py (variable DEV_VERSION)
Expand All @@ -25,3 +28,5 @@ scalaVersion=2.13.6
task=build
org.gradle.jvmargs=-Xmx2g -Xss4m -XX:+UseParallelGC
org.gradle.parallel=true
skipSigning=true
jfrogRepoUrl=https://linkedin.jfrog.io/artifactory/kafka

0 comments on commit 54fb2e3

Please sign in to comment.