In my .gitlab-ci.yml
I need to have multiple line python -c 'stuff on multiple lines'
with this:
image: python:latest
before_script:
- |
python3 -c 'from datetime import datetime as dt;
print(dt.now())'
I get this error::
$ python3 -c 'from datetime import datetime as dt;
/bin/bash: eval: line 69: syntax error near unexpected token `('
ERROR: Build failed: exit code 2
On this issue Multiline YAML string for GitLab CI (.gitlab-ci.yml) they talk about an echo 'multiples lines string to echo'
and propose to keep it as a one liner or to pre-process the yml with ruamel.yaml
.
I think this should do it. The pipe is not supported by docker-ci.
image: python:latest
before_script:
- >
python3 -c 'from datetime import datetime as dt;
print(dt.now())'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With