1
0
mirror of https://github.com/tektoncd/catalog.git synced 2024-11-24 06:15:46 +00:00
catalog/task/jib-maven/0.5
vinamra28 e763a4473e Use latest git-clone in Task's tests
With git-clone version 0.8 and onwards, it started running as non-root
and GKE clusters were having some issues, so, we temporarily moved all
tasks to use git-clone version 0.7. Ref: https://github.com/tektoncd/catalog/pull/1079

Since we have now moved to kind clusters in our CI, this issue is now
resolved and thus moving all tasks to use latest version of git-clone

Signed-off-by: vinamra28 <jvinamra776@gmail.com>
2023-09-22 09:32:22 +01:00
..
tests Use latest git-clone in Task's tests 2023-09-22 09:32:22 +01:00
jib-maven.yaml Bump jib-maven to 0.5 2023-06-12 20:06:24 +01:00
README.md Bump jib-maven to 0.5 2023-06-12 20:06:24 +01:00

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.5/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, linux/s390x and linux/ppc64le platforms.

For linux/s390x and linux/ppc64le platforms specify MAVEN_IMAGE parameter with maven:3.6.3-adoptopenjdk-11 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 (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.