mirror of
https://github.com/bvanroll/cicdTest.git
synced 2025-08-29 12:02:47 +00:00
30 lines
969 B
YAML
30 lines
969 B
YAML
---
|
|
apiVersion: tekton.dev/v1alpha1
|
|
kind: Task
|
|
metadata:
|
|
name: build-and-push
|
|
spec:
|
|
inputs:
|
|
resources:
|
|
- name: git-source
|
|
type: git
|
|
params:
|
|
- name: pathToContext
|
|
description: The path to the build context, used by Kaniko - within the workspace
|
|
default: .
|
|
- name: pathToDockerfile
|
|
description: The path to the dockerfile to build
|
|
default: Dockerfile
|
|
- name: imageUrl
|
|
description: value should be like - us.icr.io/test_namespace/builtImageApp
|
|
- name: imageTag
|
|
description: Tag to apply to the built image
|
|
steps:
|
|
- name: build-and-push
|
|
image: gcr.io/kaniko-project/executor
|
|
command:
|
|
- /kaniko/executor
|
|
args:
|
|
- "--dockerfile=$(inputs.params.pathToContext)/dockerfile"
|
|
- "--destination=$(inputs.params.imageUrl):$(inputs.params.imageTag)"
|
|
- "--context=$(inputs.resources.git-source.path)/$(inputs.params.pathToContext)/" |