Skip to content

Commit

Permalink
Copy edit the GitLab CI entry, add it to navigation. Also add README …
Browse files Browse the repository at this point in the history
…for the section
  • Loading branch information
oleg-nenashev committed Jun 12, 2024
1 parent dcba115 commit 3e267e7
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 9 deletions.
23 changes: 23 additions & 0 deletions docs/cookbook/ci/README.md
Original file line number Diff line number Diff line change
@@ -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)

3 changes: 2 additions & 1 deletion docs/cookbook/ci/github-actions.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
11 changes: 6 additions & 5 deletions docs/cookbook/ci/gitlab-ci.md
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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.

Expand Down Expand Up @@ -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:
Expand All @@ -80,7 +81,7 @@ gradleEnterprise {

### Test building the project

The project uses the <<gradle_wrapper.adoc#gradle_wrapper_reference,Gradle Wrapper>> 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.
Expand Down Expand Up @@ -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:

Expand Down
3 changes: 2 additions & 1 deletion docs/cookbook/ci/jenkins.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
3 changes: 2 additions & 1 deletion docs/cookbook/ci/teamcity.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
3 changes: 2 additions & 1 deletion docs/cookbook/ci/travis-ci.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
2 changes: 2 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 3e267e7

Please sign in to comment.