1
0
mirror of https://github.com/tektoncd/catalog.git synced 2024-11-23 06:08:46 +00:00
catalog/jib-gradle
Scott f2ab700283 Update READMEs of tasks that use workspaces in place of pipeline resources
The tasks in this commit were updated at some point to use workspaces instead of
pipeline resources but their readmes still refer to the resources.

This commit updates the readmes to remove mention of pipeline resources and link
out to pipeline's workspaces doc.
2020-07-09 15:41:56 +01:00
..
tests jib-gradle: use workspace instead of GitResource 🐐 2020-03-11 07:43:48 -05:00
jib-gradle.yaml Run jib-gradle as root 2020-04-10 07:51:02 +01:00
OWNERS Create OWNERS from jib team 2020-03-02 01:37:44 -06:00
README.md Update READMEs of tasks that use workspaces in place of pipeline resources 2020-07-09 15:41:56 +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://raw.githubusercontent.com/tektoncd/catalog/master/jib-gradle/jib-gradle.yaml

Parameters

  • 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)

Workspaces

  • source: A Workspace volume containing the source to build.

Resources

Outputs

  • image: The Docker image name to apply to the newly built image.

Usage

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

apiVersion: tekton.dev/v1alpha1
kind: PipelineResource
metadata:
  name: example-image
spec:
  type: image
  params:
  - name: url
    value: gcr.io/tekton-task-project/my-image
apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
  name: example-jib-gradle
spec:
  taskRef:
    name: jib-gradle
  params:
  - name: DIRECTORY
    value: ./examples/helloworld
  workspaces:
  - name: source
    persistentVolumeClaim:
      claimName: my-source
  resources:
    outputs:
    - name: image
      resourceRef:
        name: example-image

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.