3

My gitlab-ci.yaml:

stages:
  - linter
  - build
  - deploy

include:
  - project: 'infrastructure/ansible-repository'
    ref: '1.0.0'
    file: '/project-pipeline.yml'

In the project-pipeline.yml there's a before_script: where I need to access a directory from the infrastructure/ansible-repository. At the moment I git clone the whole repository.

My Question: is there an include for a directory or something like that?

valentin1807
  • 108
  • 6

1 Answers1

0

It seems you are looking for a way to download a sub directory from a remote repository. Based on which repository hosting platform (E.g. GitLab, GitHub, BitBucket and ...) you used Or your interaction with that directory there are many solutions.
Such as git archive, git clone --filter, svn tool, wget, sparse checkout and so on, which all described in this helpful post:

How do I clone a subdirectory only of a Git repository?

Amir Dadkhah
  • 1,074
  • 2
  • 11
  • 17