Add ci/cd and fix multiple pods issues
This commit is contained in:
40
infrastructure/ci-cd/tekton/tasks/kaniko-build.yaml
Normal file
40
infrastructure/ci-cd/tekton/tasks/kaniko-build.yaml
Normal file
@@ -0,0 +1,40 @@
|
||||
# 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: {}
|
||||
Reference in New Issue
Block a user