【发布时间】: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