mirror of
https://github.com/tektoncd/catalog.git
synced 2024-11-21 05:55:35 +00:00
1c7fd558fd
few Tasks still uses PipelineResources which is no longer available in latest version of pipelines hence marking them as deprecated Signed-off-by: vinamra28 <jvinamra776@gmail.com>
65 lines
1.9 KiB
YAML
65 lines
1.9 KiB
YAML
apiVersion: tekton.dev/v1beta1
|
||
kind: Task
|
||
metadata:
|
||
name: jib-maven
|
||
labels:
|
||
app.kubernetes.io/version: "0.1"
|
||
annotations:
|
||
tekton.dev/pipelines.minVersion: "0.12.1"
|
||
tekton.dev/categories: Image Build
|
||
tekton.dev/tags: image-build
|
||
tekton.dev/displayName: "jib maven"
|
||
tekton.dev/platforms: "linux/amd64"
|
||
tekton.dev/deprecated: "true"
|
||
spec:
|
||
description: >-
|
||
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.
|
||
|
||
params:
|
||
- name: DIRECTORY
|
||
description: The directory containing the app, relative to the source repository root
|
||
default: .
|
||
- name: CACHE
|
||
description: The name of the volume for caching Maven artifacts and base image layers
|
||
default: empty-dir-volume
|
||
- name: INSECUREREGISTRY
|
||
description: Whether to allow insecure registry
|
||
default: "false"
|
||
workspaces:
|
||
- name: source
|
||
resources:
|
||
outputs:
|
||
- name: image
|
||
type: image
|
||
steps:
|
||
- name: build-and-push
|
||
image: gcr.io/cloud-builders/mvn@sha256:57523fc43394d6d9d2414ee8d1c85ed7a13460cbb268c3cd16d28cfb3859e641 #tag: latest
|
||
# Make sh evaluate $HOME.
|
||
script: |
|
||
#!/bin/sh
|
||
mvn -B \
|
||
-Duser.home=$HOME \
|
||
-Djib.allowInsecureRegistries=$(params.INSECUREREGISTRY) \
|
||
-Djib.to.image=$(resources.outputs.image.url) \
|
||
compile \
|
||
com.google.cloud.tools:jib-maven-plugin:build
|
||
workingDir: $(workspaces.source.path)/$(params.DIRECTORY)
|
||
env:
|
||
- name: HOME
|
||
value: /workspace
|
||
- name: "DOCKER_CONFIG"
|
||
value: $(credentials.path)/.docker/
|
||
volumeMounts:
|
||
- name: $(params.CACHE)
|
||
mountPath: /workspace/.m2
|
||
subPath: m2-cache
|
||
- name: $(params.CACHE)
|
||
mountPath: /workspace/.cache
|
||
subPath: jib-cache
|
||
|
||
volumes:
|
||
- name: empty-dir-volume
|
||
emptyDir: {}
|