Is it possible to reuse shared volume for nested pipelines triggered through “codefresh-run” step?
Currently no. The original idea is that each pipeline has a specific scope and handles only a specific task. More details are here Introduction to Codefresh pipelines · Codefresh | Docs
Could you describe a bit your scenario so that I can understand your use case better?
In most cases, you can simply merge the two pipelines together and create a single one (if they need to share info in that way).
Alternatively you can use an upload/download mechanism (for example with an S3 bucket) if you want to move large amounts of data from one pipeline to next. I believe however that in most cases simply merging the two pipelines is easier.
Thank you @Kostis.
I have several multistep flows:
- prepare codebase (checkout repo, pull submodules, generate code from protocol buffers),
- test application backend (run unit tests for multiple languages, run integration tests),
- test frontend application (run unit tests, run acceptance tests).
I thought I can make them as pipelines that can be called from another ones (if sharing the volume would be possible).
And I wanted to have several “main” pipelines that are triggered on specific events:
- if changed are related to any backend service, then run pipelines 1+2,
- if changed are related to frontend, then run 1+3,
- if changes are related to some common code, like API specs, then run 1+2+3.
As of now I would need to duplicate code to every of those pipelines, or there’s other way not to do that?
So what I suggest is the following
- You have a single pipeline that has all 3 flows
- Each step has a condition so that it can be enabled/disabled
- You create 3 different triggers (one of each use case). For each trigger you set a different variable like BACKEND_ONLY=TRUE, FRONTEND_ONLY=TRUE and so on
- When the pipeline runs it executes only the steps required according to the variables passed
The end result is a single pipeline that only runs what is needed. There is no duplication at all.
Also if you have a monorepo, be sure not to miss our monorepo trigger support.
So unless I am missing something, this is another one of those cases where a single pipeline is better.
Let me know if that helps. I am happy to clarify more or even provide more instructions and screenshots on how to achieve this.
I will actually put your case in my backlog for a dedicated example in our documentation.