1
0
mirror of https://github.com/tektoncd/catalog.git synced 2024-11-26 06:23:37 +00:00

Update git-clone task and document changes in behaviour

Earlier git-clone assumes `master` as default branch, but after #2835
`master` is no more default branch. Hence, updated the git clone task
fetch a remote repository's default branch instead of assuming "master"
when revision is "".

Signed-off-by: Divyansh42 <diagrawa@redhat.com>
This commit is contained in:
Divyansh42 2020-07-20 13:18:31 +05:30 committed by tekton-robot
parent 28667d230d
commit 88bc2b5230
4 changed files with 12 additions and 16 deletions

View File

@ -53,4 +53,3 @@ The following pipelines demonstrate usage of the git-clone Task:
- [Cloning a branch](../0.1/samples/git-clone-checking-out-a-branch.yaml)
- [Checking out a specific git commit](../0.1/samples/git-clone-checking-out-a-commit.yaml)
- [Checking out a git tag and using the "commit" Task Result](../0.1/samples/using-git-clone-result.yaml)

View File

@ -116,4 +116,4 @@ spec:
exit $EXIT_CODE
fi
# Make sure we don't add a trailing newline to the result!
echo -n "$RESULT_SHA" > $(results.commit.path)
echo -n "$RESULT_SHA" > $(results.commit.path)

View File

@ -1,10 +1,6 @@
# Git Task
# `git-clone`
This `Task` is Git task to work with repositories used by other tasks
in your Pipeline.
## `git-clone`
**Please Note: this Task is only compatible with Tekton Pipelines versions 0.11-rc1 and greater!**
**Please Note: this Task is only compatible with Tekton Pipelines versions 0.14.0 and greater!**
This `Task` has two required inputs:
@ -32,8 +28,8 @@ as well as
### Parameters
* **url**: git url to clone (_required_)
* **revision**: git revision to checkout (branch, tag, sha, ref…) (_default_: master)
* **refspec**: git refspec to fetch before checking out revision (_default_:refs/heads/master:refs/heads/master)
* **revision**: git revision to checkout (branch, tag, sha, ref…) (_default_: "")
* **refspec**: git refspec to fetch before checking out revision (_default_:"")
* **submodules**: defines if the resource should initialize and fetch the submodules (_default_: true)
* **depth**: performs a shallow clone where only the most recent commit(s) will be fetched (_default_: 1)
* **sslVerify**: defines if http.sslVerify should be set to true or false in the global git config (_default_: true)
@ -51,11 +47,12 @@ as well as
## Usage
### `git-clone`
If the `revision` is not provided in the param of the taskrun
then it will auto-detect the branch as specified by the `default`
in the respective git repository.
The following pipelines demonstrate usage of the git-clone Task:
- [Cloning a branch](../0.1/samples/git-clone-checking-out-a-branch.yaml)
- [Checking out a specific git commit](../0.1/samples/git-clone-checking-out-a-commit.yaml)
- [Checking out a git tag and using the "commit" Task Result](../0.1/samples/using-git-clone-result.yaml)
- [Cloning a branch](../0.2/samples/git-clone-checking-out-a-branch.yaml)
- [Checking out a specific git commit](../0.2/samples/git-clone-checking-out-a-commit.yaml)
- [Checking out a git tag and using the "commit" Task Result](../0.2/samples/using-git-clone-result.yaml)

View File

@ -28,7 +28,7 @@ spec:
- name: revision
description: git revision to checkout (branch, tag, sha, ref…)
type: string
default: master
default: ""
- name: refspec
description: (optional) git refspec to fetch before checking out revision
default: ""