[英]gitlab-ci.yml python -c 'multiple line cmd' failed
In my .gitlab-ci.yml
I need to have multiple line python -c 'stuff on multiple lines' 在我的
.gitlab-ci.yml
我需要在多行上有多行python -c'的东西'
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
. 在这个问题上,GitLab CI的多行YAML字符串(.gitlab-ci.yml)他们讨论了一个
echo 'multiples lines string to echo'
并建议将其保持为单行或使用ruamel.yaml
预处理yml。
I think this should do it. 我认为应该这样做。 The pipe is not supported by docker-ci.
docker-ci不支持管道。
image: python:latest
before_script:
- >
python3 -c 'from datetime import datetime as dt;
print(dt.now())'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.