-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
git-init: add support for fetching submodules 🚝 #1531
Conversation
It will do those commands by default as they are no-op. Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
@@ -111,3 +111,45 @@ func Commit(logger *zap.SugaredLogger, revision, path string) (string, error) { | |||
} | |||
return strings.TrimSuffix(output, "\n"), nil | |||
} | |||
|
|||
func SubmoduleFetch(logger *zap.SugaredLogger, path string) error { | |||
// HACK: This is to get git+ssh to work since ssh doesn't respect the HOME |
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.
This looks like this hack is copied from Fetch()
. Opportunity to de-dup by creating a helper func?
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.
@sbwsg indeed 😛 I was a bit lazy 🤫, I need to enhance that 😉
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.
nice 👍
@@ -29,6 +29,7 @@ var ( | |||
revision = flag.String("revision", "", "The Git revision to make the repository HEAD") | |||
path = flag.String("path", "", "Path of directory under which git repository will be copied") | |||
terminationMessagePath = flag.String("terminationMessagePath", "/dev/termination-log", "Location of file containing termination message") | |||
submodules = flag.Bool("submodules", true, "Initialize and fetch git submodules") |
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.
WDYT about surfacing this option all the way up into the Git resource, so users can turn it off if they'd prefer?
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.
@imjasonh I was waiting for someone to comment this to do it 😛
The following is the coverage report on pkg/.
|
5520f42
to
d3c8290
Compare
docs/resources.md
Outdated
@@ -252,6 +252,9 @@ Params that can be added are the following: | |||
(branch, tag, commit SHA or ref) to clone. You can use this to control what | |||
commit [or branch](#using-a-branch) is used. _If no revision is specified, | |||
the resource will default to `latest` from `master`._ | |||
1. `submodules`: defines if the resource should initialize and | |||
fetch the submodules, value is either `true` or `false`. _If note |
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.
s/note/not/
@@ -111,3 +111,45 @@ func Commit(logger *zap.SugaredLogger, revision, path string) (string, error) { | |||
} | |||
return strings.TrimSuffix(output, "\n"), nil | |||
} | |||
|
|||
func SubmoduleFetch(logger *zap.SugaredLogger, path string) error { | |||
// HACK: This is to get git+ssh to work since ssh doesn't respect the HOME |
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.
nice 👍
/lgtm |
The following is the coverage report on pkg/.
|
Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
d3c8290
to
56fb88e
Compare
The following is the coverage report on pkg/.
|
/lgtm |
/test pull-tekton-pipeline-integration-tests |
As a new tekton fanboy here at JPL, I'm impressed by the quality of the PR & discussion. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dibyom 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
It will do those commands by default as they are no-op.
Closes #1523
Signed-off-by: Vincent Demeester vdemeest@redhat.com
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.
Double check this list of stuff that's easy to miss:
cmd
dir, please updatethe release Task to build and release this image.
Reviewer Notes
If API changes are included, additive changes must be approved by at least two OWNERS and backwards incompatible changes must be approved by more than 50% of the OWNERS, and they must first be added in a backwards compatible way.
Release Notes