Initial clone with pipeline.
This commit is contained in:
commit
1399f382b1
6 files changed
+140
No files matched your search
@@ -0,0 +1,53 @@
|
||||
apiVersion: tekton.dev/v1beta1
|
||||
kind: Pipeline
|
||||
metadata:
|
||||
name: cat-git-repo
|
||||
spec:
|
||||
description: A test pipeline.
|
||||
params:
|
||||
- name: repo-url
|
||||
type: string
|
||||
description: The git repository URL to clone from.
|
||||
workspaces:
|
||||
- name: shared-data
|
||||
description: Shared data.
|
||||
- name: git-credentials
|
||||
description: My ssh credentials
|
||||
tasks:
|
||||
- name: fetch-repo
|
||||
workspaces:
|
||||
- name: output
|
||||
workspace: shared-data
|
||||
- name: ssh-directory
|
||||
workspace: git-credentials
|
||||
params:
|
||||
- name: url
|
||||
value: $(params.repo-url)
|
||||
taskSpec:
|
||||
workspaces:
|
||||
- name: output
|
||||
- name: ssh-directory
|
||||
params:
|
||||
- name: url
|
||||
steps:
|
||||
- image: 192.168.1.128:8443/gitssh:latest
|
||||
script: |
|
||||
set -x
|
||||
cp -r $(workspaces.ssh-directory.path) ~/.ssh
|
||||
chmod 700 ~/.ssh
|
||||
chmod -R 400 ~/.ssh/*
|
||||
git clone $(params.url) $(workspaces.output.path)
|
||||
|
||||
- name: cat-readme
|
||||
runAfter: ["fetch-repo"]
|
||||
workspaces:
|
||||
- name: source
|
||||
workspace: shared-data
|
||||
taskSpec:
|
||||
workspaces:
|
||||
- name: source
|
||||
steps:
|
||||
- image: docker.io/debian:latest
|
||||
script: |
|
||||
set -x
|
||||
cat $(workspaces.source.path)/README
|
||||
Reference in new issue
Block a user