From 3e267e70ec3c710022b500199bff064c9434d7d6 Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Wed, 12 Jun 2024 08:11:52 +0200 Subject: [PATCH] Copy edit the GitLab CI entry, add it to navigation. Also add README for the section --- docs/cookbook/ci/README.md | 23 +++++++++++++++++++++++ docs/cookbook/ci/github-actions.md | 3 ++- docs/cookbook/ci/gitlab-ci.md | 11 ++++++----- docs/cookbook/ci/jenkins.md | 3 ++- docs/cookbook/ci/teamcity.md | 3 ++- docs/cookbook/ci/travis-ci.md | 3 ++- mkdocs.yml | 2 ++ 7 files changed, 39 insertions(+), 9 deletions(-) create mode 100644 docs/cookbook/ci/README.md diff --git a/docs/cookbook/ci/README.md b/docs/cookbook/ci/README.md new file mode 100644 index 0000000..db95768 --- /dev/null +++ b/docs/cookbook/ci/README.md @@ -0,0 +1,23 @@ +# Using Gradle with Continuous Integration Systems + +Gradle has many integrations with Continuous Integration (CI) +and Continuous Delivery (CD) systems. +Below you can find references to integrations and best practices. + +!!! warning + This section is under active development. + The pages might be outdated, contributions are welcome! + +## Recipes + +- [GitHub Actions](./github-actions.md) +- [GitLab CI](./gitlab-ci.md) +- [Jenkins](jenkins.md) +- [TeamCity](./teamcity.md) +- [Travis CI](./travis-ci.md) + +## External Pages + +- [Tekton task for Gradle](https://hub.tekton.dev/tekton/task/gradle) +- [CircleCI orb for Gradle](https://circleci.com/developer/orbs/orb/circleci/gradle) + diff --git a/docs/cookbook/ci/github-actions.md b/docs/cookbook/ci/github-actions.md index d5e8b8c..46fd1ee 100644 --- a/docs/cookbook/ci/github-actions.md +++ b/docs/cookbook/ci/github-actions.md @@ -1,6 +1,7 @@ # Executing Gradle builds on GitHub Actions -**TIP:** Top engineering teams using GitHub Actions have been able to reduce CI build time by up to 90% by using the Gradle Build Cache. [Register here](https://gradle.org/training/#build-cache-deep-dive) for our Build Cache training session to learn how your team can achieve similar results. +!!! tip + Top engineering teams using GitHub Actions have been able to reduce CI build time by up to 90% by using the Gradle Build Cache. [Register here](https://gradle.org/training/#build-cache-deep-dive) for our Build Cache training session to learn how your team can achieve similar results. Building Gradle projects doesn't stop with the developer's machine. [Continuous Integration](https://en.wikipedia.org/wiki/Continuous_integration) (CI) has been a long-established practice for running a build for every single change committed to version control to tighten the feedback loop. diff --git a/docs/cookbook/ci/gitlab-ci.md b/docs/cookbook/ci/gitlab-ci.md index 99febd9..f01766e 100644 --- a/docs/cookbook/ci/gitlab-ci.md +++ b/docs/cookbook/ci/gitlab-ci.md @@ -1,6 +1,7 @@ # Executing Gradle builds on GitLab CI -TIP: Top engineering teams using GitHub Actions have been able to reduce CI build time by up to 90% by using the Gradle Build Cache. https://gradle.org/training/#build-cache-deep-dive[Register here] for our Build Cache training session to learn how your team can achieve similar results. +!!! tip + Top engineering teams using GitLab CI have been able to reduce CI build time by up to 90% by using the Gradle Build Cache. https://gradle.org/training/#build-cache-deep-dive[Register here] for our Build Cache training session to learn how your team can achieve similar results. Building Gradle projects doesn't stop with the developer's machine. https://en.wikipedia.org/wiki/Continuous_integration[Continuous Integration] (CI) has been a long-established practice for running a build for every single change committed to version control to tighten the feedback loop. @@ -22,7 +23,7 @@ GitLab CI is a cloud-based CI solution provider built directly into GitLab, maki ## Setup a Gradle project on GitLab -If you have a Gradle project hosted on GitLab, you can skip this step and move directly to <<#sec:configure_gitlab,Configure GitLab CI>>. +If you have a Gradle project hosted on GitLab, you can skip this step and move directly to [Configure GitLab CI](.#configure-gitlab-ci) If not, follow these steps to initialize a new Gradle project on GitLab. @@ -57,7 +58,7 @@ $ git push ### Enable Build Scan™ publishing -https://scans.gradle.com[Gradle Build Scans] are a great way to view your build results and provide valuable insights into your build. +[Gradle Build Scans](https://scans.gradle.com) are a great way to view your build results and provide valuable insights into your build. To publish Build Scans from GitLab CI, you'll need to pre-approve the Terms & Conditions. To do so, add the following content to the top of your `settings.gradle[.kts]` file. GitLab CI sets the "CI" environment variable: @@ -80,7 +81,7 @@ gradleEnterprise { ### Test building the project -The project uses the <> for building the project. +The project uses the Gradle Wrapper for building the project. It is a recommended practice for any Gradle project as it enables your project to build on CI without installing the Gradle runtime. Before asking GitLab CI to build your project, it's useful to ensure that it builds locally. @@ -147,7 +148,7 @@ Any subsequent push to the repository will trigger the pipeline to run. By default, no files are persisted between CI runs, so each job must download all dependencies again. We can configure GitLab to cache some files between jobs. This is especially efficient when running your own GitLab CI runner, as the cache is stored locally on the runner. -CAUTION: The publicly available shared runners store their cache in a remote location. As the cache grows, downloading the cache archive, extracting it, and uploading it again at the end of the job may take more time than not using any cache. For this reason, we recommend only caching the Gradle Wrapper. For caching everything else, see configuring a link:https://docs.gradle.org/current/userguide/build_cache.html[Gradle Remote Build Cache]. +CAUTION: The publicly available shared runners store their cache in a remote location. As the cache grows, downloading the cache archive, extracting it, and uploading it again at the end of the job may take more time than not using any cache. For this reason, we recommend only caching the Gradle Wrapper. For caching everything else, see configuring a [Gradle Remote Build Cache](https://docs.gradle.org/current/userguide/build_cache.html). To reuse some files between jobs, add the following configuration to your existing jobs: diff --git a/docs/cookbook/ci/jenkins.md b/docs/cookbook/ci/jenkins.md index f111402..ea38b72 100644 --- a/docs/cookbook/ci/jenkins.md +++ b/docs/cookbook/ci/jenkins.md @@ -1,6 +1,7 @@ # Executing Gradle builds on Jenkins -**TIP:** Top engineering teams using Jenkins have been able to reduce CI build time by up to 90% by using the Gradle Build Cache. [Register here](https://gradle.org/training/#build-cache-deep-dive) for our Build Cache training session to learn how your team can achieve similar results. +!!! tip + Top engineering teams using Jenkins have been able to reduce CI build time by up to 90% by using the Gradle Build Cache. [Register here](https://gradle.org/training/#build-cache-deep-dive) for our Build Cache training session to learn how your team can achieve similar results. Building Gradle projects doesn't stop with the developer's machine. [Continuous Integration](https://en.wikipedia.org/wiki/Continuous_integration) (CI) has been a long-established practice for running a build for every single change committed to version control to tighten the feedback loop. diff --git a/docs/cookbook/ci/teamcity.md b/docs/cookbook/ci/teamcity.md index 7cc4946..afed39c 100644 --- a/docs/cookbook/ci/teamcity.md +++ b/docs/cookbook/ci/teamcity.md @@ -1,6 +1,7 @@ # Executing Gradle builds on TeamCity -**TIP:** Top engineering teams using TeamCity have been able to reduce CI build time by up to 90% by using the Gradle Build Cache. [Register here](https://gradle.org/training/#build-cache-deep-dive) for our Build Cache training session to learn how your team can achieve similar results. +!!! tip + Top engineering teams using TeamCity have been able to reduce CI build time by up to 90% by using the Gradle Build Cache. [Register here](https://gradle.org/training/#build-cache-deep-dive) for our Build Cache training session to learn how your team can achieve similar results. Building Gradle projects doesn't stop with the developer's machine. [Continuous Integration](https://en.wikipedia.org/wiki/Continuous_integration) (CI) has been a long-established practice for running a build for every single change committed to version control to tighten the feedback loop. diff --git a/docs/cookbook/ci/travis-ci.md b/docs/cookbook/ci/travis-ci.md index a433f5a..e2f262c 100644 --- a/docs/cookbook/ci/travis-ci.md +++ b/docs/cookbook/ci/travis-ci.md @@ -1,6 +1,7 @@ # Executing Gradle builds on Travis CI -**TIP:** Top engineering teams using Travis CI have been able to reduce CI build time by up to 90% by using the Gradle Build Cache. [Register here](https://gradle.org/training/#build-cache-deep-dive) for our Build Cache training session to learn how your team can achieve similar results. +!!! tip + Top engineering teams using Travis CI have been able to reduce CI build time by up to 90% by using the Gradle Build Cache. [Register here](https://gradle.org/training/#build-cache-deep-dive) for our Build Cache training session to learn how your team can achieve similar results. Building Gradle projects doesn't stop with the developer's machine. [Continuous Integration](https://en.wikipedia.org/wiki/Continuous_integration) (CI) has been a long-established practice for running a build for every single change committed to version control to tighten the feedback loop. diff --git a/mkdocs.yml b/mkdocs.yml index 469fd4c..ee24b90 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -106,9 +106,11 @@ nav: - Cookbook: - Overview: cookbook/README.md - Gradle on CI: + - Summary: cookbook/ci/README.md - Jenkins: cookbook/ci/jenkins.md - TeamCity: cookbook/ci/teamcity.md - GitHub Actions: cookbook/ci/github-actions.md + - GitLab CI: cookbook/ci/gitlab-ci.md - Travis CI: cookbook/ci/travis-ci.md - Contributing: cookbook/CONTRIBUTING.md - Participate: