This commit is contained in:
2025-08-04 06:26:23 +00:00
parent 7dc67ca8ac
commit e6c919ec2f
13 changed files with 242 additions and 98 deletions

View File

@ -0,0 +1,39 @@
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: build-image
namespace: tekton-demo
spec:
params:
- name: IMAGE
type: string
description: Image name to build
- name: GIT_URL
type: string
- name: GIT_REVISION
type: string
default: main
steps:
- name: clone
image: alpine/git
script: |
#!/bin/sh
git clone $(params.GIT_URL) /workspace/source
cd /workspace/source
git checkout $(params.GIT_REVISION)
- name: build-and-push
image: gcr.io/kaniko-project/executor:latest
args:
- "--dockerfile=/workspace/source/Dockerfile"
- "--context=/workspace/source/"
- "--destination=$(params.IMAGE)"
volumeMounts:
- name: docker-config
mountPath: /kaniko/.docker
workspaces:
- name: source
volumes:
- name: docker-config
secret:
secretName: harbor-dockerconfig