python - 在 bitbucket 中找不到 terraform
问题描述
所以我正在尝试在 bitbucket 上创建一个管道。在我的本地计算机上,我导航到该文件夹cd terraform/environments/dev
并运行terraform init
没有问题。但是,当我在 bitbucket 上运行测试管道时,它会在第二个操作时停止,因为
bash: terraform: command not found
我怎样才能解决这个问题?我相信我需要以某种方式在 bitbucket 上安装 terraform,但我不知道该怎么做。我是否使用 python pip 命令?如果是这样,如何以及为什么?
image: atlassian/default-image:2
pipelines:
branches:
test:
- step:
name: 'Navigate to Dev'
script:
- cd terraform/environments/dev
condition:
changesets:
includePaths:
- "terraform/modules"
- "terraform/environments/dev"
- step:
name: 'Initialize Terraform'
script:
- terraform init
解决方案
您需要构建代理的正确映像。在这种情况下,代理基本上只需要安装和访问 terraform:
image: hashicorp/terraform
这将解决您的问题。当然,您也可以将图像的标签设置为您特定版本的 Terraform。
推荐阅读
- mysql - MySQL 使用 Group by 和 Order by
- .net-core - 将带有公钥的 .pem 加载到 x509Certificate2
- spring - 将 Spring Boot 从 2.1.4 更新到 2.2.5 后找不到 bean entityManagerFactory
- macos - 如何为 Sublime Text 3 创建永久 subl 链接?(麦克卡特琳娜)
- javascript - 是否有某种role.edit 切换功能?我正在制作一个应该在权限之间切换但似乎无法做到的命令
- c - 使用 for 循环迭代二维数组的时间复杂度是多少?
- macos - 使用 SSH 连接附加到 tmux 会话时如何在我的机器上打开新窗口?
- python - 我的 Python unittest 脚本在 Eclipse PyDev 中失败,但在 Spyder 中有效
- javascript - 带有 Javascript 的 Node.js 中的 Discord Bot - 如何从公会或频道获取所有用户?
- visual-c++ - LLVM 调试元数据中的“retainedNodes”是什么?