mirror of
https://github.com/tektoncd/catalog.git
synced 2024-12-11 07:50:29 +00:00
b4e6060a8c
This migrate jib-maven to use `workspace` instead of an input `GitResource`. This also updates e2e tests to use a `Pipeline` in order to clone the repository in the workspace. Signed-off-by: Vincent Demeester <vdemeest@redhat.com> |
||
---|---|---|
.. | ||
tests | ||
jib-maven.yaml | ||
OWNERS | ||
README.md |
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
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)
Workspaces
- source: A
git
-typePipelineResource
specifying the location of 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 (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/v1beta1
kind: TaskRun
metadata:
name: example-jib-maven
spec:
taskRef:
name: jib-maven
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-maven-plugin
in your pom.xml
.
See setup instructions for Maven for more information.