Browse Source

Remove TravisCI (#1337)

* Remove TravisCI

With the migration to CircleCI complete, this change removes the
Travis CI configurations that are no longer needed.

* Correcting License Headers
pull/1340/head
Kevin Davis 4 years ago committed by GitHub
parent
commit
04bd147fba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      .circleci/config.yml
  2. 45
      .travis.yml
  3. 50
      RELEASE.md
  4. 2
      scripts/no-git-changes.sh
  5. 2
      scripts/release.sh
  6. BIN
      travis/codesigning.asc.enc
  7. 196
      travis/publish.sh
  8. 41
      travis/settings.xml
  9. 21
      travis/sign.sh

4
.circleci/config.yml

@ -63,7 +63,7 @@ jobs:
- image: circleci/openjdk:14-buster - image: circleci/openjdk:14-buster
<<: *defaults <<: *defaults
deploy-snapshot: deploy:
docker: docker:
- image: circleci/openjdk:8 - image: circleci/openjdk:8
steps: steps:
@ -82,7 +82,7 @@ workflows:
- jdk8 - jdk8
- jdk11 - jdk11
- jdk14 - jdk14
- deploy-snapshot: - deploy:
requires: requires:
- jdk8 - jdk8
- jdk11 - jdk11

45
.travis.yml

@ -1,45 +0,0 @@
dist: xenial
language: java
cache:
directories:
- $HOME/.m2
jdk:
- openjdk8
- openjdk11
- openjdk14
before_install: ./travis/sign.sh
script:
- ./mvnw clean install -B
# fail build if there are any local changes to sources
- ./travis/no-git-changes.sh
jobs:
include:
- stage: snapshot
name: "Deploy Snapshot to OSSRH"
if: branch = master AND type != pull_request AND commit_message !~ /^(prepare release ([0-9\.]+))$/
jdk: openjdk8
install: true
script:
- ./mvnw -B -nsu -s ./travis/settings.xml -P release -pl -:feign-benchmark -DskipTests=true deploy
- stage: release
name: "Release to OSSRH and Central"
if: tag =~ /^[0-9\.]+$/
# there is one module (java-11) that needs to be build and released with JDK 11
jdk: openjdk8
install: true
script:
- ./mvnw -B -nsu -s ./travis/settings.xml -P release -pl -:feign-benchmark -DskipTests=true deploy
- stage: release-jdk11
name: "Release JDK 11 Modules to OSSRH and Central"
if: tag =~ /^[0-9\.]+$/
jdk: openjdk11
install: true
script:
# first install the pre-requisite projects, then deploy just the java 11 module
- ./mvnw -B -nsu -s ./travis/settings.xml -P java11 -pl :feign-java11 -am -DskipTests=true install
- ./mvnw -B -nsu -s ./travis/settings.xml -P release,java11 -pl :feign-java11 -DskipTests=true deploy

50
RELEASE.md

@ -10,54 +10,46 @@ This repo uses [semantic versions](http://semver.org/). Please keep this in mind
1. **Push a git tag** 1. **Push a git tag**
Prepare the next release by running the [release script](travis/release.sh) from a clean checkout of the master branch. Prepare the next release by running the [release script](scripts/release.sh) from a clean checkout of the master branch.
This script will: This script will:
* Update all versions to the next release. * Update all versions to the next release.
* Tag the release. * Tag the release.
* Update all versions to the next development version. * Update all versions to the next development version.
1. **Wait for Travis CI** 1. **Wait for CI**
This part is controlled by the [travis configuration](.travis.yml), specifically the `release` stage. Which This part is controlled by the [CircleCI configuration](.circleci/config.yml), specifically the `deploy` job. Which
creates the release artifacts and deploys them to maven central. creates the release artifacts and deploys them to maven central.
## Credentials ## Credentials
Credentials of various kind are needed for the release process to work. If you notice something Credentials of various kind are needed for the release process to work. If you notice something
failing due to unauthorized, re-encrypt them using instructions at the bottom of the `.travis.yml` failing due to unauthorized, you will need to modify the stored values in `Sonatype` [CircleCI Context](https://circleci.com/docs/2.0/contexts/)
for the OpenFeign organization.
Ex You'll see comments like this:
```yaml
env:
global:
# Ex. travis encrypt BINTRAY_USER=your_github_account
- secure: "VeTO...
```
To re-encrypt, you literally run the commands with relevant values and replace the "secure" key with the output:
```bash
$ travis encrypt BINTRAY_USER=adrianmole
Please add the following to your .travis.yml file:
secure: "mQnECL+dXc5l9wCYl/wUz+AaYFGt/1G31NAZcTLf2RbhKo8mUenc4hZNjHCEv+4ZvfYLd/NoTNMhTCxmtBMz1q4CahPKLWCZLoRD1ExeXwRymJPIhxZUPzx9yHPHc5dmgrSYOCJLJKJmHiOl9/bJi123456=" `SONATYPE_USER` - the username of the Sonatype account used to upload artifacts.
``` `SONATYPE_PASSWORD` - password for the Sonatype account.
`GPG_KEY` - the gpg key used to sign the artifacts.
`GPG_PASSPHRASE` - the passphrase for the gpg key
### Troubleshooting invalid credentials ### Troubleshooting invalid credentials
If you receive a '401 unauthorized' failure from jCenter or Bintray, it is If the `deploy` job fails due to invalid credentials, double check the `SONATYPE_USER` and `SONATYPE_PASSWORD`
likely `BINTRAY_USER` or `BINTRAY_KEY` entries are invalid, or possibly the user variables first and correct them.
associated with them does not have rights to upload.
The least destructive test is to try to publish a snapshot manually. By passing ### Troubleshooting GPG issues
the values Travis would use, you can kick off a snapshot from your laptop. This
is a good way to validate that your unencrypted credentials are authorized.
Here's an example of a snapshot deploy with specified credentials. If the `deploy` job fails when signing artifacts, the GPG key may have expired or is incorrect. To update the
```bash `GPG_KEY`, you must export a valid GPG key to ascii and replace all newline characters with `\n`. This will
$ BINTRAY_USER=adrianmole BINTRAY_KEY=ed6f20bde9123bbb2312b221 TRAVIS_PULL_REQUEST=false TRAVIS_TAG= TRAVIS_BRANCH=master travis/publish.sh allow CircleCi to inject the key into the environment in a way where it can be imported again. Use the following command
to generate the key file.
```shell
gpg -a --export-secret-keys | cat -e | sed | sed 's/\$/\\n/g' > gpg_key.asc
``` ```
Paste the contents of this file into the `GPG_KEY` variable in the context and try the job again.
## First release of the year ## First release of the year
The license plugin verifies license headers of files include a copyright notice indicating the years a file was affected. The license plugin verifies license headers of files include a copyright notice indicating the years a file was affected.

2
travis/no-git-changes.sh → scripts/no-git-changes.sh

@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# #
# Copyright 2012-2019 The Feign Authors # Copyright 2012-2020 The Feign Authors
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at # in compliance with the License. You may obtain a copy of the License at

2
travis/release.sh → scripts/release.sh

@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# #
# Copyright 2012-2019 The Feign Authors # Copyright 2012-2020 The Feign Authors
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at # in compliance with the License. You may obtain a copy of the License at

BIN
travis/codesigning.asc.enc

Binary file not shown.

196
travis/publish.sh

@ -1,196 +0,0 @@
#!/usr/bin/env bash
#
# Copyright 2012-2019 The Feign Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
#
# taken from OpenZipkin
set -euo pipefail
set -x
build_started_by_tag() {
if [ "${TRAVIS_TAG}" == "" ]; then
echo "[Publishing] This build was not started by a tag, publishing snapshot"
return 1
else
echo "[Publishing] This build was started by the tag ${TRAVIS_TAG}, publishing release"
return 0
fi
}
is_pull_request() {
if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then
echo "[Not Publishing] This is a Pull Request"
return 0
else
echo "[Publishing] This is not a Pull Request"
return 1
fi
}
is_travis_branch_master() {
if [ "${TRAVIS_BRANCH}" = master ]; then
echo "[Publishing] Travis branch is master"
return 0
else
echo "[Not Publishing] Travis branch is not master"
return 1
fi
}
check_travis_branch_equals_travis_tag() {
#Weird comparison comparing branch to tag because when you 'git push --tags'
#the branch somehow becomes the tag value
#github issue: https://github.com/travis-ci/travis-ci/issues/1675
if [ "${TRAVIS_BRANCH}" != "${TRAVIS_TAG}" ]; then
echo "Travis branch does not equal Travis tag, which it should, bailing out."
echo " github issue: https://github.com/travis-ci/travis-ci/issues/1675"
exit 1
else
echo "[Publishing] Branch (${TRAVIS_BRANCH}) same as Tag (${TRAVIS_TAG})"
fi
}
check_release_tag() {
tag="${TRAVIS_TAG}"
if [[ "$tag" =~ ^[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+$ ]]; then
echo "Build started by version tag $tag. During the release process tags like this"
echo "are created by the 'release' Maven plugin. Nothing to do here."
exit 0
elif [[ ! "$tag" =~ ^release-[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+$ ]]; then
echo "You must specify a tag of the format 'release-0.0.0' to release this project."
echo "The provided tag ${tag} doesn't match that. Aborting."
exit 1
fi
}
print_project_version() {
./mvnw help:evaluate -N -Dexpression=project.version|sed -n '/^[0-9]/p'
}
is_release_commit() {
project_version="$(print_project_version)"
if [[ "$project_version" =~ ^[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+$ ]]; then
echo "Build started by release commit $project_version. Will synchronize to maven central."
return 0
else
return 1
fi
}
release_version() {
echo "${TRAVIS_TAG}" | sed 's/^release-//'
}
safe_checkout_master() {
# We need to be on a branch for release:perform to be able to create commits, and we want that branch to be master.
# But we also want to make sure that we build and release exactly the tagged version, so we verify that the remote
# master is where our tag is.
git checkout -B master
git fetch origin master:origin/master
commit_local_master="$(git show --pretty='format:%H' master)"
commit_remote_master="$(git show --pretty='format:%H' origin/master)"
if [ "$commit_local_master" != "$commit_remote_master" ]; then
echo "Master on remote 'origin' has commits since the version under release, aborting"
exit 1
fi
}
javadoc_to_gh_pages() {
version="$(print_project_version)"
rm -rf javadoc-builddir
builddir="javadoc-builddir/$version"
# Collect javadoc for all modules
for jar in $(find . -name "*${version}-javadoc.jar"); do
module="$(echo "$jar" | sed "s~.*/\(.*\)-${version}-javadoc.jar~\1~")"
this_builddir="$builddir/$module"
if [ -d "$this_builddir" ]; then
# Skip modules we've already processed.
# We may find multiple instances of the same javadoc jar because of, for instance,
# integration tests copying jars around.
continue
fi
mkdir -p "$this_builddir"
unzip "$jar" -d "$this_builddir"
# Build a simple module-level index
echo "<li><a href=\"${module}/index.html\">${module}</a></li>" >> "${builddir}/index.html"
done
# Update gh-pages
git fetch origin gh-pages:gh-pages
git checkout gh-pages
rm -rf "$version"
mv "javadoc-builddir/$version" ./
rm -rf "javadoc-builddir"
# Update simple version-level index
if ! grep "$version" index.html 2>/dev/null; then
echo "<li><a href=\"${version}/index.html\">${version}</a></li>" >> index.html
fi
# Ensure links are ordered by versions, latest on top
sort -rV index.html > index.html.sorted
mv index.html.sorted index.html
git add "$version"
git add index.html
git commit -m "Automatically updated javadocs for $version"
git push origin gh-pages
}
#----------------------
# MAIN
#----------------------
if ! is_pull_request && build_started_by_tag; then
check_travis_branch_equals_travis_tag
check_release_tag
fi
# skip license on travis due to #1512
./mvnw install -nsu -Dlicense.skip=true
# formatter errors:
if [ -z $(git status --porcelain) ];
then
echo "No changes detected, all good"
else
echo "The following files have formatting changes:"
git status --porcelain
echo ""
echo "Please run 'mvn clean install' locally to format files"
exit 1
fi
# If we are on a pull request, our only job is to run tests, which happened above via ./mvnw install
if is_pull_request; then
true
# If we are on master, we will deploy the latest snapshot or release version
# - If a release commit fails to deploy for a transient reason, delete the broken version from bintray and click rebuild
elif is_travis_branch_master; then
./mvnw --batch-mode -s ./.settings.xml -Prelease -nsu -pl -:feign-benchmark -DskipTests deploy
# If the deployment succeeded, sync it to Maven Central. Note: this needs to be done once per project, not module, hence -N
if is_release_commit; then
./mvnw --batch-mode -s ./.settings.xml -nsu -N io.zipkin.centralsync-maven-plugin:centralsync-maven-plugin:sync
javadoc_to_gh_pages
fi
# If we are on a release tag, the following will update any version references and push a version tag for deployment.
elif build_started_by_tag; then
safe_checkout_master
# skip license on travis due to #1512
./mvnw --batch-mode -s ./.settings.xml -Prelease -nsu -DreleaseVersion="$(release_version)" -Darguments="-DskipTests -Dlicense.skip=true" release:prepare
fi

41
travis/settings.xml

@ -1,41 +0,0 @@
<!--
Copyright 2012-2019 The Feign Authors
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License
is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
or implied. See the License for the specific language governing permissions and limitations under
the License.
-->
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>ossrh</id>
<username>${env.SONATYPE_USER}</username>
<password>${env.SONATYPE_PASSWORD}</password>
</server>
</servers>
<profiles>
<profile>
<id>ossrh</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<gpg.executable>gpg</gpg.executable>
<gpg.keyname>${env.GPG_KEYNAME}</gpg.keyname>
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
</properties>
</profile>
</profiles>
</settings>

21
travis/sign.sh

@ -1,21 +0,0 @@
#!/usr/bin/env bash
#
# Copyright 2012-2019 The Feign Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
#
# skip signing when building pull requests
if [[ "$TRAVIS_PULL_REQUEST" = "false" ]]; then
echo "[ENVIRONMENT] Preparing Signing Signatures"
openssl aes-256-cbc -K $encrypted_8beb152aadd6_key -iv $encrypted_8beb152aadd6_iv -in travis/codesigning.asc.enc -out travis/codesigning.asc -d
gpg --fast-import travis/codesigning.asc
fi
Loading…
Cancel
Save