1
0
mirror of https://github.com/tektoncd/catalog.git synced 2024-11-29 06:34:08 +00:00
catalog/task/jib-gradle/0.4
vinamra28 d65ed39437 Use git-clone 0.7 instead of latest in Tasks' test
With git-clone version 0.8, Task now runs as non-root and with this change I
guess it's not working well with our GKE clusters and tests started
failing in nightly runs.

For now changing the version of git-clone to use 0.7 so that for now CI
is unblocked 😅

Signed-off-by: vinamra28 <jvinamra776@gmail.com>
2022-09-27 15:05:12 +02:00
..
tests Use git-clone 0.7 instead of latest in Tasks' test 2022-09-27 15:05:12 +02:00
jib-gradle.yaml Update jib-gradle task to be chains compatible 2022-03-23 19:37:21 +00:00
README.md [TEP-0110] Update Tekton Catalog installation instructions 2022-08-16 16:25:52 +01:00

Jib Gradle

This Task builds Java/Kotlin/Groovy/Scala source into a container image using Google's Jib tool.

Jib works with Gradle and Maven projects, and this template is for Gradle projects.

Install the Task

kubectl apply -f https://api.hub.tekton.dev/v1/resource/tekton/task/jib-gradle/0.4/raw

Parameters

  • BUILDER_IMAGE: The location of the gradle builder image. (default: gcr.io/cloud-builders/gradle@sha256:96d6343589392afd9eab8c4463ec899b8b1c972e7cd70678a70a4821c16eb4c9)
  • IMAGE: Reference of the image gradle will produce.
  • DIRECTORY: The directory in the source repository where source should be found. (default: .)
  • CACHE: The name of the volume for caching Gradle artifacts, local Maven repository, and base image layers (default: empty-dir-volume)
  • INSECUREREGISTRY: Whether to allow insecure registry. (default: "false")
  • EXTRA_ARGS: Provides extra arguments to the gradle jib build (default: "")

Workspaces

  • source: A Workspace containing the source to build.

Results

  • IMAGE_DIGEST: The digest of the image just built.
  • IMAGE_URL: URL of the image just built.

Platforms

The Task can be run on linux/amd64, linux/s390x, and linux/ppc64le platforms.

For linux/s390x and linux/ppc64le platforms specify BUILDER_IMAGE parameter with gradle:5.6.2-jdk11 value in TaskRun or PipelineRun.

Usage

This TaskRun runs the Task to fetch a Git repo, and build and push a container image using Jib (Gradle).

apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
  name: example-jib-gradle
spec:
  taskRef:
    name: jib-gradle
  params:
  - name: IMAGE
    value: gcr.io/my-repo/my-image
  - name: DIRECTORY
    value: ./examples/helloworld
  workspaces:
  - name: source
    persistentVolumeClaim:
      claimName: my-source

If you would like to customize the container, configure the jib-gradle-plugin in your build.gradle. See setup instructions for Gradle for more information.