'How to run git clone command in a pipeline step LFS enabled
I've a pipeline that is cloning another repository. Pipeline below is running on yyy repository, and it's supposed to clone xxx repository and do some work on it, then upload the results to AWS S3, I have lots of object to be worked on, so git clone step should be LFS enabled. git lfs client is configured on my base image. LFS is also enabled on my xxx repository. My deployment consumes so much time to clone repo with LFS enabled.
- step:
name: "Pipeline"
services:
- docker
caches:
- docker
script:
- ...
- ...
- ...
- ...
- git clone [email protected]:xxx.git
I've tried
clone:
lfs: true
option to reduce the consumed time but it seems it doesn't work with the setup above.
How can I reduce time consumption for this setup? Is there any workaround here?
Thank you.
Solution 1:[1]
It can be a little bit weird but I came up with the solution below,
I gave
clone:
enabled: false
in the pipeline, and I cloned the repo in the script part. Because my repo is huge, I limited everything to consume less time.
git clone [email protected]:xxx/<repo-name>.git --depth 1 --no-tags --single-branch -b <branch> --no-checkout .
It's working like a charm :)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Oguzhan Aygun |
