--wip-- [skip ci]

This commit is contained in:
Valentin Carroy 2025-03-24 16:46:27 +01:00
parent 4fe0c0b1a0
commit 94b8589b7c
6 changed files with 88 additions and 0 deletions

13
kustomization.yaml Normal file
View File

@ -0,0 +1,13 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- https://storage.googleapis.com/tekton-releases/operator/latest/release.yaml
- https://raw.githubusercontent.com/tektoncd/operator/main/config/crs/kubernetes/config/all/operator_v1alpha1_config_cr.yaml
# Catalog
- https://raw.githubusercontent.com/tektoncd/catalog/main/task/git-clone/0.6/git-clone.yaml
secretGenerator:
- name: git-credentials
envs:
- secrets/gitcred.txt

View File

@ -0,0 +1,33 @@
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: test-clone
spec:
description: |
This pipeline clones a git repo, then echoes the README file to the stdout.
params:
- name: repo-url
type: string
description: The git repo URL to clone from.
workspaces:
- name: shared-data
description: |
This workspace contains the cloned repo files, so they can be read by the
next task.
tasks:
- name: git-clone
taskRef:
name: git-clone
workspaces:
- name: output
workspace: shared-data
params:
- name: url
value: $(params.repo-url)
- name: show-readme
runAfter: ["git-clone"]
taskRef:
name: show-readme
workspace:
- name: source
workspace: shared-data

View File

@ -0,0 +1,24 @@
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
generateName: test-clone-run-
spec:
pipelineRef:
name: test-clone
podTemplate:
securityContext:
fsGroup: 65532
workspaces:
- name: shared-data
volumeClaimTemplate:
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
- name: git-credentials
params:
- name: repo-url
value: https://forge.cadoles.com/CNOUS/mse.git

View File

@ -0,0 +1,14 @@
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: show-readme
spec:
description: Read and display README file.
workspaces:
- name: source
steps:
- name: read
image: alpine:latest
script: |
#!/usr/bin/env sh
cat $(workspaces.source.path)/README.md

1
secrets/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/gitcred.txt

3
secrets/gitcred.txt.dist Normal file
View File

@ -0,0 +1,3 @@
id_rsa=
known_hosts=
config=