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

config: add clone options #120

Merged
merged 1 commit into from
Sep 25, 2019
Merged

config: add clone options #120

merged 1 commit into from
Sep 25, 2019

Conversation

camandel
Copy link
Contributor

A try to fix issue #3 adding a new optional parameter ("options") in clone "step".
Example:

        steps:
          - clone:
              options: "--recurse-submodules --depth 1"

@camandel camandel changed the title configadd clone options config: add clone options Sep 23, 2019
@sgotti
Copy link
Member

sgotti commented Sep 23, 2019

@camandel Thanks for the PR. There are two different ways to implement what is asked in #3

  • This way: an option to specify git clone arguments.
  • Just set some options to the clone step that will be converted to git arguments (i.e depth) and let the user do everything else in a successive run step (i.e. git submodule update --recursive --remote)

This former is more powerful but also more confusing since the user can pass everything as "options".

The latter is less error prone and won't clash with possible changes to the clone scripts generated by agola. For example, if in future we want to clone with a default user defined global/per project depth we could do this, with the former it'll be difficult since it'll depend on the arguments order/override logic if the user already provided a depth as an option.

User can always use a custom clone step if they want to do special things.

@camandel
Copy link
Contributor Author

@sgotti code updated to use the second approach. At the moment only these two parameters can be converted to git arguments:

        steps:
          - clone:
              depth: 1
              recursesubmodules: true

internal/config/config.go Outdated Show resolved Hide resolved
Copy link
Member

@sgotti sgotti left a comment

Choose a reason for hiding this comment

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

@camandel LGTM. Merging. Thanks!

@sgotti sgotti merged commit 2d6fd96 into agola-io:master Sep 25, 2019
@camandel camandel deleted the clone_options branch September 26, 2019 08:51
tulliobotti64 pushed a commit to tulliobotti64/agola that referenced this pull request Oct 19, 2022
tulliobotti64 pushed a commit to tulliobotti64/agola that referenced this pull request Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants