Skip to content
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

Merged
merged 1 commit into from
Feb 13, 2020

Conversation

vdemeester
Copy link
Member

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.

@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 6, 2019
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]>
workingdir: /workspace/src/
command:
- /bin/bash
- -c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tab -> spaces

@ghost
Copy link

ghost commented Dec 16, 2019

one minor nit
/lgtm

@tekton-robot tekton-robot assigned ghost Dec 16, 2019
@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 16, 2019
apiVersion: tekton.dev/v1alpha1
kind: Task
metadata:
name: fetch-git
Copy link
Member

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:

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

Copy link
Member Author

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

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

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?

@chmouel
Copy link
Member

chmouel commented Feb 13, 2020

Let's merge this and address the other cleanups/improvement in a follow-up review

/lgtm
/approve

@tekton-robot
Copy link

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 13, 2020
@tekton-robot tekton-robot merged commit bac8db4 into tektoncd:master Feb 13, 2020
@vdemeester vdemeester deleted the 95-git-fetch branch February 13, 2020 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants