my `bitbucket-pipelines.yml` file contains the following lines:
default:
- step:
caches:
- node
script:
- echo "{\"infuraKey\": \"$INFURA_KEY\"}" > infura-key.json
- npm i ganache-core
- npm i
- npm test
the line with `echo "...` generates a validation error. What is the correct syntax?
Hi Micha,
YAML parses the ': ' (colon immediately followed by a space) as a map. Which breaks the parsing we expect (a string).
To working around this, you can either
Place the entire command into a string:
default:
- step:
caches:
- node
script:
- 'echo "{\"infuraKey\": \"$INFURA_KEY\"}" > infura-key.json'
- npm i ganache-core
- npm i
- npm test
Or, place the command onto a separate line:
default:
- step:
caches:
- node
script:
- |
echo "{\"infuraKey\": \"$INFURA_KEY\"}" > infura-key.json
- npm i ganache-core
- npm i
- npm test
Thanks,
Phil
Thanks - this was puzzling the hell out of me why the colon was causing a YAML syntax error
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.