Hey I have requirement where I have a git mono repo with multiple Dockerfiles. So I want to build docker images when there are changes to Dockerfiles in the git repo. For a single Dockerfile I was able to build. I was unable to do If there are two Dockerfiles that I need to build dynamically by fetching modified docker files in git repo and pass them to build steps.
Is there any way that I can loop the build step in my freestyle step for multiple Dockerfiles?.
Does Codefresh support for loop through a step?.
Thanks for the response. I can trigger the pipeline by restrictions. But I want to build the multiple Dockerfiles dynamically by looping as I don’t know which Dockerfile I was going to build. I will try that. Thanks for the support.
Another option to explore is to create different triggers for you mono repo (1 for each subfolder).
Then associate VARIABLES to each trigger that would point to each subfolder and use those to select the correct sub-directory, image name to build, …
We use a similar approach to build our typed steps (GitHub - codefresh-io/steps).
So for the ServiceNow plugin,
for example, I have a trigger looking for changes in
incubating/service-now/**
I have the following variables (under Advanced options)
That way each plugin is built individually, only when something changes in its subfolder without the need for complex looping mechanism to detect changes.
the downside is that you need to explicitly add trigger manually (it can also be done with the CLI if you have a bunch of them to do at once)