0

I have the following .gitlab-ci.yml configuration:

default: ... stages: - ... variables: # COLORS E: "\e[1;91m" # ERROR S: "\e[1;32m" # SUCCESS I: "\e[1;34m" # INFO R: "\033[0m" # RESET # Other vars ... .script-before: &script-before - ... .other-script: &other-script job_1: before_script: - *script-before stage: ... only: - ... variables: ... script: - *other-script 

The pipelines don't run with these colors variables. I have tried changing the names of the variables but still the pipelines will not trigger.

1 Answer 1

2

Your pipeline doesn't run because the slash in the color isn't being escaped properly for whatever reason, so it causes the yml to not parse. While I'm not completely sure exactly why it parses that way, you can fix the issue by simply escaping the slash directly, as such:

variables: # COLORS E: "\\e[1;91m" # ERROR S: "\\e[1;32m" # SUCCESS I: "\\e[1;34m" # INFO R: "\\033[0m" # RESET test: image: alpine:latest script: - echo -e "${E}test${R} in red font" 

which will then print:

test in red font

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.