I have a mono-repo with several services in it (in separate folders). I've used a condition to make sure that only when files within that folder have been modified, do I then build and deploy that service.
My build pipeline has something like this step:
- step:
name: Deploy
script:
- export SERVICE_NAME=my-api
- pipe: atlassian/aws-ecs-deploy:1.12.1
variables:
condition:
changesets:
includePaths:
- "MyProject.Shared.*/**"
- "MyProject.SubProject.*/**"
This appears to work OK, and I can see that unmodified steps are skipped in the pipeline build view.
My question is how does the pipeline builder determine what has changed?
I was presuming it would compare between the current build, and the last time that build worked, but it appears to do a comparison between the current build and the previous one.
Is that correct?
The problem I have, is that if the pipeline fails for some any reason that doesn't require a change to that code to fix it, then my service will not be deployed, as the code being monitored hasn't changed.
Why would the fix be outside a code change? Maybe the infrastructure wasn't deployed before the build, or the image repository hasn't been created yet, or other things outside of my control.