Injecting an environment file mid-build Follow
Hi, we are migrating our builds from Jenkins to TeamCity. Is it possible to take an environment file and inject it when going through the build process in TeamCity?
Backstory: In Jenkins we create an environment file in one step, then inject it in another and then carry on with the rest of the build, which uses the variables set by the file.
Can the "logic" be still the same, or do we need to change the scripts when migrating to TeamCity?
Please sign in to leave a comment.
There is no option to inject en environment file in TeamCity. You can create additional build step, that updates build parameters using service message.
Please feel free to create a feature request in our tracker.
I've also found the related request in our tracker: https://youtrack.jetbrains.com/issue/TW-12987, please vote for it and try the suggested workaround: https://youtrack.jetbrains.com/issue/TW-12987#comment=27-163653.
So in the command line build step (custom script mode) you can add %env.TEAMCITY_CAPTURE_ENV% to the end of the script. I've tested and it works for me. However it does not work if I try to run the command line build script from file. The related issue is https://youtrack.jetbrains.com/issue/TW-36886. Please vote for it as well.
This ticket is somewhat dated, but for those people finding this ticket looking for injection of build.properties
May be of use to you.