gpt4 book ai didi

terraform - gitlab-ci:Terraform 没有名为 "sh"的命令。你的意思是 "show"

转载 作者:行者123 更新时间:2023-12-04 17:19:30 25 4
gpt4 key购买 nike

我正在尝试在 Gitlab CI 上设置 Terrafom 验证。
但是构建失败并显示错误:“Terraform 没有名为“sh”的命令。您的意思是“显示”吗?
为什么会发生?怎么可能修好?
我的 .gitlab-ci.yml

image: hashicorp/terraform:light

before_script:
- terraform init

validate:
script:
- terraform validate

最佳答案

您需要覆盖 terraform 图像中的入口点,以便您可以访问 shell。

image: 
name: hashicorp/terraform:light
entrypoint: [""]

before_script:
- terraform init

validate:
script:
- terraform validate
也可以看看官方的gitlab documentation如何将 terraform 与 gitlab 集成,因为有一个模板。

关于terraform - gitlab-ci:Terraform 没有名为 "sh"的命令。你的意思是 "show",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67115574/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com