[英]gitlab job is running even if there is no changes in the schedule pipeline
[英]Error when using yq image in gitlab pipeline job
我有一个 gitlab 管道作业,它使用 yq 工具从 yaml 文件中提取版本号,然后将其导出为环境变量。 我使用 mikefarah/yq:4.27.2 作为基础图像。 管道代码是:
prepare-version:
image: mikefarah/yq:4.27.2
stage: prepare
script:
- ver=$(yq '.version' versions.yml)
- echo "version=${ver}" >> version.env
artifacts:
reports:
dotenv: version.env
管道总是失败:
Using docker image sha256:cecdbf2efcf7240d3378dd188844b2b5805420eef692dfb98aa3a1b6d366ef5a for mikefarah/yq:4.27.2 with digest mikefarah/yq@sha256:856f7ab12c58608d422a742a4917e6998ad065d9d48a5b1cd69c3ce8fa80f3fa ...
Error: unknown shorthand flag: 'c' in -c
Usage:
yq eval [expression] [yaml_file1]... [flags]
Aliases:
eval, e
Examples:
# Reads field under the given path for each file
yq e '.a.b' f1.yml f2.yml
# Prints out the file
yq e sample.yaml
使用时
yq '.version' 版本.yml
在本地使用相同的 yq 版本一切正常。 但在管道中它失败了。 任何想法为什么会发生这种情况?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.