How to return values from a CI-independent cake script? #3102
-
Hi, I am currently having the use case where I whould like write a cake which does not have any CI tool specific code in it but does the CI specific steps afterwards (or beforehand). Example: Deploy "App-1.2.3-beta-4.zip" (not a static artifact) to the azure devops pipeline artifacts The question is: How do I pass value/values from Cake back to the calling pipeline? Reasons: To be able to quickly migrate the script between gitlab/azure/jenkins without the need to integrate all those informations into the script itself. Could not find a non CI tool specific way to do so far (eg. setting a env var from within cake). |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The problem with environment variables is that they are set for the running process. Every CI system has a slightly different and specific approach to handle this scenario. Cake.Issues.Recipe is an example for this. |
Beta Was this translation helpful? Give feedback.
The problem with environment variables is that they are set for the running process. Every CI system has a slightly different and specific approach to handle this scenario.
What I do in these cases is to write an interface as abstraction layer, with concrete implementations for different CI systems.
Cake.Issues.Recipe is an example for this.