-
Notifications
You must be signed in to change notification settings - Fork 579
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a git task to clone a repository without PipelineResource #123
Conversation
178dc52
to
ee1d545
Compare
This is part of documenting and providing Tasks in the catalog that would help user not using PipelineResource. Related to [tektoncd/pipeline#1369](tektoncd/pipeline#1369). Signed-off-by: Vincent Demeester <[email protected]>
ee1d545
to
72e7446
Compare
workingdir: /workspace/src/ | ||
command: | ||
- /bin/bash | ||
- -c |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tab -> spaces
one minor nit |
apiVersion: tekton.dev/v1alpha1 | ||
kind: Task | ||
metadata: | ||
name: fetch-git |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about calling this by the git action? i.e: git-pull
workingdir: /workspace/src/ | ||
command: | ||
- /ko-app/git-init | ||
args: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add the parameter -depth
and default to 1
this way it can be use in git clone --branch master --depth 1
and download 10KB instead of the whole history 100MB of the repo?
cc @vdemeester
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@csantanapr yeah we will add support for --depth
. We need to update this yaml to use something else than git-init
, using the git
binary itself and script
most likely.
value: github.com/tektoncd/pipeline | ||
- name: cat-readme | ||
taskRef: | ||
name: echo-readme |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be cat-readme
?
name: fetch-git | ||
params: | ||
- name: url | ||
value: github.com/tektoncd/pipeline |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm running into below error when trying to play around with this locally:
Error running git [remote add origin github.com/tektoncd/pipeline]: exit status 128\nfatal: remote origin already exists.
Is this something special with git-init
command?
Let's merge this and address the other cleanups/improvement in a follow-up review /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: chmouel The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Changes
This is part of documenting and providing Tasks in the catalog that
would help user not using PipelineResource.
Related to tektoncd/pipeline#1369.
Part of #95
Signed-off-by: Vincent Demeester [email protected]
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
See the contribution guide
for more details.