This is not exactly the answer to your initial question, but it may be an alternative way to achieve your goals.
Firstly, sharing the CF distribution between all environments (including prod) carries a risk with it - when you need to check CF configuration changes, you will definitely modify dist prod CFs with unverified changes that can have significant consequences.
Secondly, although it’s great if you can test the whole environment at all stages of the CI / CD pipeline, this is not always possible (and CF is especially harmful for it) - therefore, it must find a balance between short feedback cycles and thorough testing.
The solution usually introduces additional steps to your pipeline, where the early stages give quick feedback on the most common problems, and the later stages give slower feedback on the less common problems.
In your case, I would suggest:
- Deployment deployments do not deploy CF tests aimed directly at the API gateway.
- Deploying the wizard / By default, DO deploys CF - into an "intermediate" environment - tests target the intermediate CF distribution.
- Successfully tested releases on Wednesday "intermediate" advance to production
By implementing an intermediate environment, you get quick feedback on the branch lines, but you still have the option of checking things out by cache before entering prod.
If you make changes to the CF configuration, you can make your deployment script dynamically decide whether to include CF in the deployment of the branch from any trigger (perhaps the word “cloudy” is present in the branch name - although this might be a little “magic” for some !), and you can test these changes in the branch before merging with the master for testing in the stage.
source share