【问题标题】:Terraform command not recognized in Gitlab Windows Runners在 Gitlab Windows Runners 中无法识别 Terraform 命令
【发布时间】:2021-03-09 05:11:54
【问题描述】:

我在本地 Windows 机器上设置了 Gitlab 运行器。定义了一些作业,但其中一个是“terraform version”,但是在 Gitlab CI 中作业失败,下面是错误,

$ terraform version
terraform: The term 'terraform' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

注意:从工作目录执行时,无需 Gitlab,Terraform 在本地也能正常工作。

有人可以在这里通过一些灯光吗,谢谢。

【问题讨论】:

  • 你需要在gitlab runner中安装terraform
  • 我尝试在 yml 文件中添加命令以下载 curl -0 releases.hashicorp.com/terraform/0.13.5/… --output terraform_0.13.5_windows_amd64.zip -d C:\GitLab-Runner\ 并尝试放置 terraform 可执行文件在本地windows机器中创建gitlab上所有文件的路径中的文件,但仍然没有运气......
  • 尝试运行which terraform 命令并粘贴输出。单独下载 terraform 不是必须的,它必须在某个路径中并且可以执行。
  • 不幸的是,在安装了 gitlab runner 的 Windows Powershell 中,terraform 不起作用。

标签: gitlab terraform devops gitlab-ci-runner terraform-provider-aws


【解决方案1】:

由于 Windows 问题未解决或在我的情况下无法解决,我尝试了另一种选择,即。通过在同一台 Windows 机器上安装适用于 Linux 的 Windows 子系统 (WSL)。 谢谢大家。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-06-05
    • 1970-01-01
    • 2017-11-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-21
    相关资源
    最近更新 更多