1
0
mirror of https://github.com/tektoncd/catalog.git synced 2024-11-23 06:08:46 +00:00
catalog/jib-maven
Chmouel Boudjnah 43f52adb4d Add Taskrun e2e testing
We are adding a test directory with a collection of yamls to runs.

There is a hook system which allows to do some manipulation on task for the
tests (as we don't want to modify the main task). Or if we want to do some extra
pre-setup before setting the taskrun

For example on buildah/kaniko would add a registry as a sidecontainers on
the tasks so we can do our testings without having to upload it somewhere.

S2I is disabled too due of not working on other cluster than openshift.

Closes: #103
2019-11-14 08:10:31 -06:00
..
tests Add Taskrun e2e testing 2019-11-14 08:10:31 -06:00
jib-maven.yaml Add Taskrun e2e testing 2019-11-14 08:10:31 -06:00
README.md Adding a Task for jib-maven 2019-05-04 09:20:53 -05: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://raw.githubusercontent.com/tektoncd/catalog/master/jib-maven/jib-maven.yaml

Inputs

Parameters

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

Resources

  • source: A git-type PipelineResource specifying the location of the source to build.

Outputs

Resources

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

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/v1alpha1
kind: TaskRun
metadata:
  name: example-jib-maven
spec:
  taskRef:
    name: jib-maven
  inputs:
    params:
    - name: DIRECTORY
      value: ./examples/helloworld
    resources:
    - name: source
      resourceSpec:
        type: git
        params:
        - name: url
          value: https://github.com/my-user/my-repo
  outputs:
    resources:
    - name: image
      resourceRef:
        name: example-image

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.