Hello,
I'm wondering why bitbucket pipelines are parsing stings inside the script section.
image: ubuntu:18.04pipelines: default: - step: script: - echo "Echo from pipelines : ${MY_VAR}"
This is not valid because of the ":" !!
Hi Hamdi,
The colon character is causing the particular line you have to be parsed as a map instead of a string. This is part of the YAML specification, which the bitbucket-pipelines.yml file follows. Specifically, a colon followed by a space will make the entire line interpreted as a map instead of a string.
There are a few ways to work around this, which will all make the line be interpreted as a string instead.
1. Remove the space after the colon
image: ubuntu:18.04pipelines: default: - step: script: - echo "Echo from pipelines :${MY_VAR}"
2. Escape the space after the colon
image: ubuntu:18.04pipelines: default: - step: script: - echo "Echo from pipelines ${MY_VAR}"
3. Quote the entire command line, which will indicate the line is a string.
image: ubuntu:18.04pipelines: default: - step: script: - 'echo "Echo from pipelines : ${MY_VAR}"'
4. Quote the colon character
image: ubuntu:18.04pipelines: default: - step: script: - echo "Echo from pipelines ':' ${MY_VAR}"
Thanks,
Phil
Hello Phil,
Thank you for the answer.
For me, only the option 3 works since I was using 'echo -e'.
Thanks
The php-codeception uses an option string like a YAML-syntax:
./vendor/bin/codecept run --override="paths: output: ./test-reports"
Colons and unquoted spaces are mandatory. The only way I have found is:
pipelines: default: - step: script: - printf './vendor/bin/codecept run --override="paths\x3a output\x3a ./test-reports"' | sh -
It looks like you're new here. Sign in or register to get started.