You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Additional context
I am trying to replicate the gitlab environment variables locally and I am struggling. In gitlab, my script creates .ssh/config by echoing the value of the file, which is stored in gitlab variables. The script basically just does echo:
echo$VAL1>~/.ssh/config
However, no matter what multiline format I use, the line endings are striped and the multilines are converted to a single string. Either I am doing this wrong, or this is a bug.
PS. gitlab-ci-local is awesome - tyvm! I'm eager to get it working.
The text was updated successfully, but these errors were encountered:
@ANGkeith, thanks for your quick reply. I tried what you suggest and got it to work, but it only works with .env. The yaml config behaves differently and only ever produces one line.
This is exactly what I am using:
Your explanation is clear. I don't know what wizardry gitlab is using, but unfortunately it requires that I change my CI to work-around this difference in behaviour, which is unfortunate.
Incidentally, I came across another separate, but related issue. I'll raise a separate ticket.
I can confirm the quotes trick works with file .env config as well:
Minimal .gitlab-ci.yml illustrating the issue
Expected behavior
It should echo multiline values preserving the
\n
character.Actual behavior
Host information
Ubuntu
gitlab-ci-local 4.1.33
Containerd binary
No
Additional context
I am trying to replicate the gitlab environment variables locally and I am struggling. In gitlab, my script creates
.ssh/config
by echoing the value of the file, which is stored in gitlab variables. The script basically just does echo:However, no matter what multiline format I use, the line endings are striped and the multilines are converted to a single string. Either I am doing this wrong, or this is a bug.
PS.
gitlab-ci-local
is awesome - tyvm! I'm eager to get it working.The text was updated successfully, but these errors were encountered: