diff --git a/pipelines/git-pipeline.yaml b/pipelines/git-pipeline.yaml index 8093328..2336626 100644 --- a/pipelines/git-pipeline.yaml +++ b/pipelines/git-pipeline.yaml @@ -1,7 +1,7 @@ apiVersion: tekton.dev/v1beta1 kind: Pipeline metadata: - name: cat-git-repo + name: git-pipeline spec: description: A test pipeline. params: @@ -23,20 +23,8 @@ spec: 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) + taskRef: + name: j7s-git-clone - name: cat-readme runAfter: ["fetch-repo"] diff --git a/runs/git-run.yaml b/runs/git-run.yaml index 5a21cc1..92f2a78 100644 --- a/runs/git-run.yaml +++ b/runs/git-run.yaml @@ -1,10 +1,10 @@ apiVersion: tekton.dev/v1beta1 kind: PipelineRun metadata: - name: with-custom-container-2 + name: with-good-layout spec: pipelineRef: - name: cat-git-repo + name: git-pipeline workspaces: - name: shared-data volumeClaimTemplate: diff --git a/tasks/j7s-git-clone.yaml b/tasks/j7s-git-clone.yaml new file mode 100644 index 0000000..c6c5775 --- /dev/null +++ b/tasks/j7s-git-clone.yaml @@ -0,0 +1,18 @@ +apiVersion: tekton.dev/v1beta1 +kind: Task +metadata: + name: j7s-git-clone +spec: + 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) \ No newline at end of file