1
0
mirror of https://github.com/tektoncd/catalog.git synced 2024-11-24 06:15:46 +00:00
catalog/task/jib-maven/0.3/README.md
Quan Zhang e294e1246b [TEP-0110] Update Tekton Catalog installation instructions
Prior to this change, the installation instructions directly use the resource urls in the Catalog repo, which results in tight coupling between the organization and how users fetch resources (as described in TEP-0110). This commit updates the installation guide to install Tekton Catalog resources via Tekton Hub Api: https://github.com/tektoncd/hub/pull/539

This change decouples the Tekton Catalog organization from resouces resolution, which enables Tekton Catalog reorganization.
2022-08-16 16:25:52 +01:00

2.2 KiB

Jib Maven

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

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

Install the Task

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

Parameters

  • IMAGE: The name of the image to build
  • MAVEN_IMAGE: The base image for maven (default: gcr.io/cloud-builders/mvn)
  • DIRECTORY: The directory in the source repository where source should be found. (default: .)
  • CACHE: The name of the volume for caching Maven artifacts and base image layers (default: empty-dir-volume)
  • INSECUREREGISTRY: Whether to allow insecure registry (default: false)
  • CACERTFILE: CA cert file name containing the certs for TLS verify (default: service-ca.crt)

Workspaces

  • source: A Workspace containing the source to build.
  • sslcertdir: An optional Workspace containing your custom SSL certificates to connect to the registry.

Results

  • IMAGE_DIGEST: Digest of the image just built.

Platforms

The Task can be run on linux/amd64 platform.

Usage

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

apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
  name: example-jib-maven
spec:
  taskRef:
    name: jib-maven
  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-maven-plugin in your pom.xml. See setup instructions for Maven for more information.