31 lines
810 B
YAML
31 lines
810 B
YAML
# Tekton Git Clone Task for Bakery-IA CI/CD
|
|
# This task clones the source code repository
|
|
|
|
apiVersion: tekton.dev/v1beta1
|
|
kind: Task
|
|
metadata:
|
|
name: git-clone
|
|
namespace: tekton-pipelines
|
|
spec:
|
|
workspaces:
|
|
- name: output
|
|
params:
|
|
- name: url
|
|
type: string
|
|
description: Repository URL to clone
|
|
- name: revision
|
|
type: string
|
|
description: Git revision to checkout
|
|
default: "main"
|
|
steps:
|
|
- name: clone
|
|
image: alpine/git
|
|
script: |
|
|
#!/bin/sh
|
|
set -e
|
|
echo "Cloning repository: $(params.url)"
|
|
git clone $(params.url) $(workspaces.output.path)
|
|
cd $(workspaces.output.path)
|
|
echo "Checking out revision: $(params.revision)"
|
|
git checkout $(params.revision)
|
|
echo "Repository cloned successfully" |