From df596ecc7ef42a3386495d9e2c4ce370978212a1 Mon Sep 17 00:00:00 2001 From: Andres Almiray Date: Tue, 18 May 2021 15:31:11 +0200 Subject: [PATCH] Document setting up Travis-ci --- docs/modules/continuous-integration/nav.adoc | 1 + .../continuous-integration/pages/index.adoc | 3 +- .../pages/travis-ci.adoc | 63 +++++++++++++++++++ 3 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 docs/modules/continuous-integration/pages/travis-ci.adoc diff --git a/docs/modules/continuous-integration/nav.adoc b/docs/modules/continuous-integration/nav.adoc index 644b2e9..7b1252f 100644 --- a/docs/modules/continuous-integration/nav.adoc +++ b/docs/modules/continuous-integration/nav.adoc @@ -9,3 +9,4 @@ ** xref:gitlab-ci.adoc[] ** xref:jenkins.adoc[] ** xref:teamcity.adoc[] +** xref:travis-ci.adoc[] diff --git a/docs/modules/continuous-integration/pages/index.adoc b/docs/modules/continuous-integration/pages/index.adoc index dcda0ec..0b4e097 100644 --- a/docs/modules/continuous-integration/pages/index.adoc +++ b/docs/modules/continuous-integration/pages/index.adoc @@ -12,4 +12,5 @@ in the future: * xref:github-actions.adoc[] * xref:gitlab-ci.adoc[] * xref:jenkins.adoc[] -* xref:teamcity.adoc[] \ No newline at end of file +* xref:teamcity.adoc[] +* xref:travis-ci.adoc[] \ No newline at end of file diff --git a/docs/modules/continuous-integration/pages/travis-ci.adoc b/docs/modules/continuous-integration/pages/travis-ci.adoc new file mode 100644 index 0000000..9cb063d --- /dev/null +++ b/docs/modules/continuous-integration/pages/travis-ci.adoc @@ -0,0 +1,63 @@ += Travis CI + +JReleaser can be run as a deploy script in link:https://travis-ci.com/[Travis-CI]. + +NOTE: If you're already building with either Maven or Gradle then you might use the +xref:tools:jreleaser-maven.adoc[] or the xref:tools:jreleaser-gradle.adoc[] instead. + +[source] +..travis.yml +---- +language: java + +jdk: openjdk11 + +script: ./mvnw -B verify + +deploy: + - provider: script + skip_cleanup: true + script: + # Get the jreleaser downloader + - curl -sL https://git.io/get-jreleaser > get_jreleaser.java + # Download JReleaser with version = + # Change to a tagged JReleaser release + # or leave it out to pull `latest`. + - java get_jreleaser.java + # Let's check we've got the right version + - java -jar jreleaser-cli.jar --version + # Execute a JReleaser command such as 'full-release' + - java -jar jreleaser-cli.jar full-release + on: + branch: main +---- + +If you rather see what JReleaser is doing then set it up as an `after_script:` hook instead: + +[source] +---- +language: java + +jdk: openjdk11 + +script: ./mvnw -B verify + +after_script: + # Get the jreleaser downloader + - curl -sL https://git.io/get-jreleaser > get_jreleaser.java + # Download JReleaser with version = + # Change to a tagged JReleaser release + # or leave it out to pull `latest`. + - java get_jreleaser.java + # Let's check we've got the right version + - java -jar jreleaser-cli.jar --version + # Execute a JReleaser command such as 'full-release' + - java -jar jreleaser-cli.jar full-release +---- + +TIP: You may use `latest` to pull the latest stable release or `early-access` to pull the latest snapshot. + +IMPORTANT: The deploy script must run with Java 11. + +NOTE: You must use link:https://docs.travis-ci.com/user/environment-variables/[encrypted environment variables] to +configure environment variables such as `JRELEASER_GITHUB_TOKEN` and any other secrets required by the build.