27 lines
650 B
YAML
27 lines
650 B
YAML
apiVersion: tekton.dev/v1beta1
|
|
kind: Task
|
|
metadata:
|
|
name: j7s-git-clone
|
|
spec:
|
|
workspaces:
|
|
- name: output
|
|
- name: ssh-directory
|
|
params:
|
|
- name: url
|
|
- name: branch
|
|
results:
|
|
- name: hash
|
|
steps:
|
|
- image: harbor.internal.jpace121.net/k8s/gitssh:latest
|
|
script: |
|
|
set -x
|
|
cp -r $(workspaces.ssh-directory.path) ~/.ssh
|
|
chmod 700 ~/.ssh
|
|
chmod -R 400 ~/.ssh/*
|
|
ssh-keyscan -H -p 2222 git.jpace121.net >> ~/.ssh/known_hosts
|
|
|
|
git clone --single-branch --branch $(params.branch) $(params.url) $(workspaces.output.path)
|
|
|
|
cd $(workspaces.output.path)
|
|
git rev-parse HEAD > $(results.hash.path)
|