Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Commit

Permalink
Automated the release process (#201)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpkrohling authored and yurishkuro committed Jun 29, 2017
1 parent df066d3 commit 54d1381
Show file tree
Hide file tree
Showing 8 changed files with 83 additions and 36 deletions.
22 changes: 8 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
sudo: required

language: java

dist: trusty

matrix:
include:
- env:
- TESTS=true
- COVERAGE=true
- env:
- CROSSDOCK=true

services:
- docker

env:
global:
- DOCKER_VERSION=1.11.1-0~trusty
Expand All @@ -28,26 +23,25 @@ env:
- secure: q19fJLh2aO583rOALLKor4FeQr5u3EWKtUNhOyrUR9k7FLVk/9cLIrLr77DWdYxn0DE123DeHHm+GB7vEL85DmhJXUy3Bqpkjqr/eOZwtzGuCeDY9q7pO3eJJ8V3Fhw0p9rvGq1yg/nEO6S9whE+IUFxUanSIsjltM93KEfeaOGEvi5vkfKoD1etgGh8tx3d69Q17SyfHl+xRMW4KOVe3vdjUUnFPINhqmjKaYRmbsZ3yx7cuX+i6qbpW3Biypy/zjeu/35CfjQIiB8rgo8G6qtbGj9gfMzt3xmDL2LEOJtIx4nDJ3wPMVsGUGbu8LhNzX71EddbnqdWwjLnyoYAEYynu13q8rHljA+NlT8mPBP4wX00TTtJoWmwCmMnWgRcFPMS50cVBDwLLANZcVPU6iNY/+0AE4ANlzWHDLD/0pTqvYB5Z2UIVbXPuvkys7xBL5pKFnqTXVlWQuTRkSO8PXnSo24QP04AcjlkHnqNPesjkztFh4DSOfyL/6BiLebKDo6C+KNcN6Ep9SYpVfkwYDLV2qtfbiLxu4wjAgQjxPk701VGMfywmMvHaqa7UQpXQfEvHM/kTYJGknqf80WvXo/ilnvb9esANEP6cJZ3Z9h7Sq9P/ytec5NqPRaKVaMmN5bJXNY30g7MLkyD1fAMKIkaUfFdKNFzZVAAmsC7fho=
# DOCKER_PASSWORD=<docker password>
- secure: a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Vkso6FLjVg8Bl20PvDBd4mF+qpbXGZkdALfjv7cBo+oWIC/haqb6JlAGuXwJG7SuTeA/XI+us3l4U7qWhrUaxxruOAa90QhcmYLIFZuI676kbUqymqrQQdLTCa+9zj74YkZL0o2xN1DgM59wpecbP0wAhghzYgsPjo5/oAAK4F0S9YGx11SbAqoTBHN9KYwqc5USGQQPSf7Jqr6SXFo70txLkUFud/MWu2nRlWZ7khd/97vPRTSs7wHGOf20AhpvjhmWLqjjmYcDFqaiFXEzf3mHLxuEcoEqOgDrw2KuNKMMMvwmCS98U+/fU=
# SIGNING_KEY_PASSPHRASE
- secure: Yfs7DCKxxADy47Yzf7gZwWgn07QIq6YCCHkzqBtrn1y9eJxY+T8CkYoDejnc2DY4wfbD9pHhU5Dm32j6YwsQ6zw/0mYBJ5m23rvJ3flXKKBlNol3AK2Q3LhEkwegExQq1Zgik7uf/jtRBwvMB6dLR108QtJbGs+tmJ3VDVxLlHTvOxLo+X81z0eebpVPw5bUNKPgX9kimpVs63NzxVJp4FqCA37c5kx1oVgTmmZ9TeRddMLKiRUA55Dl10WmSg0kKzAQaHBNKEXUsPkh/cgD37Us1ZceUtv1STkH3dhfkqM6hs5v4PbJ5yezmtvoH/AaZmpMkbHgg7iCSd9oz73umHrtRXVXd/gvRN/QLp53RgSvHKL2SVGiclxEuEbTpTSbN467712PzojWvn1l5HRAH/WV+K4+wLKrG+THL8v3IefVA6W042UY5+Bt6uyJrE0XNf8k/QCcY7RQxwwdd4i3/f7BAM/lrNk9nmr73agx6u7DtNIwC68+daMeii4WoPev02JG95UzCH8OnnQVXlLxncQm1X5RxC20lcOXNSn3Fasrx1eRaWlxe0Ob11RIGscdPNiuH5j2l4skavTHb8JMHpdUnfc994PaKImNo9lqFw4LzoepOWHaUpyPYXJ6VqhMTIEfRFRJEwa1EY5cwszGz2+e+Mpu/GhzKsUtlpiWcfc=
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock

cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/

- "$HOME/.gradle/caches/"
- "$HOME/.gradle/wrapper/"
before_install:
- ./travis/prepare-signing.sh $encrypted_677f232983c0_key $encrypted_677f232983c0_iv
- if [ "$CROSSDOCK" == true ]; then bash ./travis/install-crossdock-deps.sh ; fi
- sudo rm -rf /usr/local/bin/thrift
- sudo cp travis/docker-thrift/thrift /usr/local/bin/


script:
- if [ "$TESTS" == true ]; then make test ; else echo 'skipping tests'; fi
- if [ "$COVERAGE" == true ]; then ./gradlew codeCoverageReport ; else echo 'skipping coverage'; fi
- if [ "$CROSSDOCK" == true ]; then bash ./travis/build-crossdock.sh ; else echo 'skipping crossdock'; fi

after_success:
- if [ "$COVERAGE" == true ]; then bash <(curl -s https://codecov.io/bash) ; fi
- if [ "$CROSSDOCK" == true ]; then ./gradlew uploadArchives -PossrhUsername="${SONATYPE_USERNAME}" -PossrhPassword="${SONATYPE_PASSWORD}" ; fi
- if [ "$CROSSDOCK" == true -a "$TRAVIS_BRANCH" == "master" -a "$TRAVIS_PULL_REQUEST" == false ]; then ./gradlew upload ; fi
30 changes: 13 additions & 17 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
# Release Process

TODO: the release process is too manual and needs to be automated
## Automatic release (preferred)

The release process consists of these steps:
1. Edit build.gradle and remove the `-SNAPSHOT` suffix from the `version` parameter
1. Add an entry to CHANGELOG.pm with description of changes in the new release
1. Commit as "Preparing release"
1. Run `make release`
* Make sure you have the right version 0.9.2 of Thrift installed: `thrift -version`
1. Once the artifacts are uploaded to Sonatype staging, release them to Maven Central
1. Add an entry to [`CHANGELOG.md`](CHANGELOG.rst) with description of changes in the new release
1. Commit your `CHANGELOG` changes
1. Tag as a version (`git tag v0.20.0`). Use the one from [`build.gradle`](build.gradle) as reference.
1. Push the tag (`git push v0.20.0`)
1. Once the *tag* build finishes in Travis, the artifacts should have been uploaded to Sonatype staging.
At this stage, you'll need to close and release the staging repository. After that, the artifacts should
soon reach Maven Central.
* https://oss.sonatype.org/, log in, go to Staging Repositories
* In the top-right corner search box type `uber`, and find your uploaded repository
* Hit Close button. Monitor status on Activity tab at the bottom, hitting Refresh.
* Once Close is successful, the Release button will become available, so hit it
* Keep hitting Refresh while sync to Maven is in progress. Once it's complete, the repository will disappear.
1. Bump the version in `build.gradle` to the next release and add `-SNAPSHOT suffix
1. Commit as "Back to development"
1. Bump the version in `build.gradle` to the next release and commit it

The `uploadArchives` step performs signing of the artifacts. For that to work the script
requires private/public keys.
## Local setup and release

The Travis build execute the `uploadArchives` task, and this task performs the signing of the artifacts.
While the Travis build is ready for that, releasing locally requires the following steps:

* install GPG: `brew install gpg`
* generate keys: `gpg --gen-key`
Expand All @@ -37,9 +39,3 @@ requires private/public keys.
* `gpg --keyserver http://keyserver.ubuntu.com:11371 --send-keys {pub key ID}`
* you can also use Web UI and upload plain test key that you can obtain via
* `gpg --armor --export {your email used for the keys}`


[ci-img]: https://travis-ci.org/uber/jaeger-client-java.svg?branch=master
[cov-img]: https://codecov.io/github/uber/jaeger-client-java/coverage.png?branch=master
[ci]: https://travis-ci.org/uber/jaeger-client-java
[cov]: https://codecov.io/github/uber/jaeger-client-java/
25 changes: 24 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import java.util.regex.Pattern

plugins {
id "org.jruyi.thrift" version "0.3.1"
id "jacoco"
Expand All @@ -8,6 +10,9 @@ plugins {
id 'ru.vyarus.animalsniffer' version '1.3.0'
}

ext.developmentVersion = '0.21.0-SNAPSHOT'


ext.opentracingVersion = '0.30.0'
ext.guavaVersion = '18.0'
ext.apacheThriftVersion = '0.9.2'
Expand All @@ -31,7 +36,7 @@ allprojects {
apply plugin: 'jacoco'

group = 'com.uber.jaeger'
version = '0.21.0-SNAPSHOT'
version = getVersionForBuild()

repositories {
mavenCentral()
Expand Down Expand Up @@ -142,9 +147,27 @@ task codeCoverageReport(type: JacocoReport, group: 'Coverage reports') {
}
}

task printVersion {
println getVersionForBuild()
}

configure(subprojects.findAll {it.name != 'jaeger-thrift'}) {
apply plugin: 'net.ltgt.errorprone'
dependencies {
errorprone 'com.google.errorprone:error_prone_core:2.0.15'
}
}

def getVersionForBuild() {
String candidateVersion = System.env.TRAVIS_TAG

if (null == candidateVersion || candidateVersion.isEmpty()) {
return ext.developmentVersion
}

if (Pattern.compile("[v]?((\\d+)\\.(\\d+)\\.(\\d+))").matcher(candidateVersion).matches()) {
return candidateVersion
}

return ext.developmentVersion
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Thu Jun 22 10:25:20 CEST 2017
#Mon Jun 26 12:27:24 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Expand Down
6 changes: 3 additions & 3 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn ( ) {
warn () {
echo "$*"
}

die ( ) {
die () {
echo
echo "$*"
echo
Expand Down Expand Up @@ -155,7 +155,7 @@ if $cygwin ; then
fi

# Escape application args
save ( ) {
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
Expand Down
34 changes: 34 additions & 0 deletions travis/prepare-signing.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash

ENCRYPTION_KEY=$1
ENCRYPTION_IV=$2

# some sanity checks first:
if [ "x${ENCRYPTION_KEY}" == "x" ]; then
echo "The encryption key has not been provided. Skipping signing preparation"
exit 0
fi

if [ "x${ENCRYPTION_IV}" == "x" ]; then
echo "The encryption initialization vector has not been provided. Skipping signing preparation"
exit 0
fi

if [ "${TRAVIS_SECURE_ENV_VARS}" == true ]; then
openssl aes-256-cbc -K "${ENCRYPTION_KEY}" -iv "${ENCRYPTION_IV}" -in travis/signing-key.asc.enc -out travis/signing-key.asc -d
if (( $? == 0 )); then
echo "Failed to decrypt the signing key. Skipping."
exit 1
fi

gpg --no-tty --batch --allow-secret-key-import --import travis/signing-key.asc
rm -rf "$HOME/.gradle/gradle.properties"
echo signing.keyId="${SIGNING_KEY_ID}" > "$HOME/.gradle/gradle.properties"
echo signing.password="${SIGNING_KEY_PASSPHRASE}" >> "$HOME/.gradle/gradle.properties"
echo ossrhUsername="${SONATYPE_USERNAME}" >> "$HOME/.gradle/gradle.properties"
echo ossrhPassword="${SONATYPE_PASSWORD}" >> "$HOME/.gradle/gradle.properties"
echo signing.secretKeyRingFile="${HOME}/.gnupg/secring.gpg" >> "$HOME/.gradle/gradle.properties"
else
echo "Travis secure env vars not set. Skipping."
exit 0
fi
Binary file added travis/signing-key.asc.enc
Binary file not shown.

0 comments on commit 54d1381

Please sign in to comment.