40 lines
1.1 KiB
YAML
40 lines
1.1 KiB
YAML
# Tekton Kaniko Build Task for Bakery-IA CI/CD
|
|
# This task builds and pushes container images using Kaniko
|
|
|
|
apiVersion: tekton.dev/v1beta1
|
|
kind: Task
|
|
metadata:
|
|
name: kaniko-build
|
|
namespace: tekton-pipelines
|
|
spec:
|
|
workspaces:
|
|
- name: source
|
|
- name: docker-credentials
|
|
params:
|
|
- name: services
|
|
type: string
|
|
description: Comma-separated list of services to build
|
|
- name: registry
|
|
type: string
|
|
description: Container registry URL
|
|
default: "gitea.bakery-ia.local:5000"
|
|
- name: git-revision
|
|
type: string
|
|
description: Git revision for image tag
|
|
default: "latest"
|
|
steps:
|
|
- name: build-and-push
|
|
image: gcr.io/kaniko-project/executor:v1.9.0
|
|
args:
|
|
- --dockerfile=$(workspaces.source.path)/services/$(params.services)/Dockerfile
|
|
- --context=$(workspaces.source.path)
|
|
- --destination=$(params.registry)/bakery/$(params.services):$(params.git-revision)
|
|
- --verbosity=info
|
|
volumeMounts:
|
|
- name: docker-config
|
|
mountPath: /kaniko/.docker
|
|
securityContext:
|
|
runAsUser: 0
|
|
volumes:
|
|
- name: docker-config
|
|
emptyDir: {} |