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

Suggestion: Allow git sparse checkout / checkout specific directory #267

Open
wyattjsmith1 opened this issue Jul 29, 2019 · 2 comments · May be fixed by #427
Open

Suggestion: Allow git sparse checkout / checkout specific directory #267

wyattjsmith1 opened this issue Jul 29, 2019 · 2 comments · May be fixed by #427

Comments

@wyattjsmith1
Copy link

As I have everything in a monorepo, it would be great if we could checkout specific directories as resources.

Consider a case with a monorepo with 2 services and a ci directory for task configurations:

/
|- ci
|- service-a
|- service-b

I only want to run tests on a specific service if the files within that service change, so I'd use two separate resources (named service-a/b) with the paths param set to their respective directories:

- type: git
  name: service-a
  source:
    uri: "https://my-repo"
    paths:
    - service-a/**
- {service b definition here}
- type: git
  name: ci
  source:
    uri: "https://my-repo"
    paths:
    - ci/**

I'd have two jobs, one for each service, and each job would start with a get: service-a/b and a get: ci:

- name: build-service-a
  plan:
  - get: service-a
    trigger: true
  - get: ci
  - task: build
    file: ci/ci/task.yaml

This is great, but it doesn't actually clone service-x and ci into the task working directory, it clones the entire repository. In the case above, the task directory would contain two instances of the monorepo, just named differently. There is no technical issue with this, but it is annoying and confusing to have to prepend /ci/ci when specifying my task.

I believe allowing a git resource to clone a sub-directory of the repository would solve this issue easily.

@stwomack
Copy link

stwomack commented Jan 5, 2021

Bump. @wyattjsmith1 Did you ever get an response on this?

@wyattjsmith1
Copy link
Author

Nope! I don't use concourse anymore, but I still think this would be a nice feature.

@caseybraithwaite caseybraithwaite linked a pull request Apr 12, 2024 that will close this issue
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 a pull request may close this issue.

2 participants