mirror of
https://github.com/bvanroll/stage-infra.git
synced 2025-09-04 14:52:48 +00:00
dont forget to add passwords to build-maven task next update
This commit is contained in:
49
Tekton/tasks/build-maven.yaml
Normal file
49
Tekton/tasks/build-maven.yaml
Normal file
@@ -0,0 +1,49 @@
|
||||
apiVersion: tekton.dev/v1alpha1
|
||||
kind: Task
|
||||
metadata:
|
||||
name: build-maven
|
||||
namespace: tekton-pipeline-1
|
||||
spec:
|
||||
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: "true"
|
||||
- name: image-name
|
||||
description: name of the image after push
|
||||
- name: image-tag
|
||||
description: tag of the image after push
|
||||
workspaces:
|
||||
- name: source
|
||||
mountpath: /source
|
||||
steps:
|
||||
- name: build-and-push
|
||||
image: gcr.io/cloud-builders/mvn
|
||||
command:
|
||||
- mvn
|
||||
- -B
|
||||
- compile
|
||||
- com.google.cloud.tools:jib-maven-plugin:build
|
||||
- -Duser.home=/tekton/home
|
||||
- -Djib.allowInsecureRegistries=$(params.INSECUREREGISTRY)
|
||||
- -Djib.to.image=docker.io/beppev/$(params.image-name):$(params.image-tag)
|
||||
- -Djib.from.auth.username=
|
||||
- -Djib.from.auth.password=
|
||||
- -Djib.from.auth.username=
|
||||
- -Djib.from.auth.password=
|
||||
workingDir: /source/$(params.DIRECTORY)
|
||||
volumeMounts:
|
||||
- name: $(params.CACHE)
|
||||
mountPath: /tekton/home/.m2
|
||||
subPath: m2-cache
|
||||
- name: $(params.CACHE)
|
||||
mountPath: /tekton/home/.cache
|
||||
subPath: jib-cache
|
||||
volumes:
|
||||
- name: empty-dir-volume
|
||||
emptyDir: {}
|
Reference in New Issue
Block a user