Do you want to save build configuration parameter to the file while the build running? If yes, you can create a command line build step that prints build configuraion parameter's value to the file, for example: echo %parameter_name% > file.txt
Unfortunately, simple echoing does not work in a Linux-based container either. At least in my case, when I have to have a well-formatted YAML file at the end. But the simple workaround with base64 encoding/decoding works pretty well.
Encode yaml:
# Mac example cat file.yaml | base64 | pbcopy
Insert the result to the configVar in TeamCity, hide it and declare it as a password.
Hi Andrei,
Do you want to save build configuration parameter to the file while the build running? If yes, you can create a command line build step that prints build configuraion parameter's value to the file, for example:
echo %parameter_name% > file.txt
Thanks, this will work.
Unfortunately this doesn't work with values containing line feeds. Is there any other way?
Please quote the parameter the same way as you'd do using command line:
echo '% parameter_name%' > file.txt
Unfortunately this doesn't work on Windows build agents.
Hi Andrei,
Did you ever achieve this for multiline teamcity parameters from a command line build step on a Windows agent?
Unfortunately, simple echoing does not work in a Linux-based container either. At least in my case, when I have to have a well-formatted YAML file at the end. But the simple workaround with base64 encoding/decoding works pretty well.
Encode yaml:
Insert the result to the configVar in TeamCity, hide it and declare it as a password.
Inside a docker container: