This commit is contained in:
2025-08-04 01:59:39 +00:00
parent ac3d1cc6a7
commit 7dc67ca8ac
9 changed files with 117 additions and 0 deletions

View File

@ -0,0 +1,34 @@
#task-build.yaml
apiVersion: tekton.dev/v1
kind: Task
metadata:
name: build-and-push
namespace: tekton-demo
spec:
params:
- name: IMAGE
type: string
description: "Target image"
- name: GIT_URL
type: string
- name: GIT_REVISION
type: string
default: "main"
steps:
- name: git-clone
image: alpine/git
script: |
#!/bin/sh
git clone $(params.GIT_URL) source
cd source
git checkout $(params.GIT_REVISION)
- name: build-image
image: gcr.io/kaniko-project/executor:latest
args:
- "--dockerfile=source/Dockerfile"
- "--context=source/"
- "--destination=$(params.IMAGE)"
- "--insecure"
- "--skip-tls-verify"