Parameters usage in bash script #11867
-
Hello, I encountered an issue regarding the parameters usage into a bash script. First, here is the configuration pipeline file:
And here is the bash script I use in the first job (
I think I didn't miss something in the usage of parameters into a pipeline. We can use a parameters value anywhere into a pipeline or a script using #{paramsvalue} right ? How can I avoid the bash script to consider the # as a comment charactere ? I tried using escape charactere like this : Maybe I missed something into the documentation regarding this subjects, but I still don't understand how to use it... Thank you for your help |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
You can't use GoCD pipeline parameters within the content of a separately source controlled shell script outside the pipeline configuration. GoCD can only replace parameters within job configuration it knows about at "trigger time", not something within source control or an artifact sourced by the agent at runtime. Presumably The shell script argument to If you want to supply variables to a shell script at runtime, you'd need to use either
Most folks will probably use env vars I imagine. |
Beta Was this translation helpful? Give feedback.
You can't use GoCD pipeline parameters within the content of a separately source controlled shell script outside the pipeline configuration.
GoCD can only replace parameters within job configuration it knows about at "trigger time", not something within source control or an artifact sourced by the agent at runtime.
Presumably
./pipelines/deployVm/windowsAzure/jobs/preConfig/preConfig.sh
is source controlled or from an artifact.The shell script argument to
bash
has no special meaning to GoCD, it doesn't even know it's a file it 'could' look inside - it's just a string it passes tobash
when forking a process within the agent.If you want to supply variables to a shell script at runtime, y…