1
0
mirror of https://github.com/tektoncd/catalog.git synced 2024-11-26 06:23:37 +00:00
catalog/task/jib-gradle/0.1
Chanseok Oh f5a4936531 Make Jib tasks future-proof with home changes
- Set HOME env to /workspace
- Use $HOME for "home" wherever possible
- Gradle: mount empty dir at ~/.gradle to make it globally writable
- Maven: script to `script:` to use "$HOME" variable
2020-07-22 19:59:00 +01:00
..
tests Update e2e scipts according to new structure 2020-07-16 18:35:59 +01:00
jib-gradle.yaml Make Jib tasks future-proof with home changes 2020-07-22 19:59:00 +01:00
OWNERS Modifies jib-gradle task according to the new reorg proposal 2020-07-10 22:06:57 +01:00
README.md Make Jib tasks future-proof with home changes 2020-07-22 19:59:00 +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/task/jib-gradle/0.1/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 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/v1beta1
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.