-1

如何在 Macbook 上安装 terragrunt 0.19.x 版本?

我试过brew install terragrunt只下载 0.18.x。

选项1:

brew install terragrunt

touch: /usr/local/Homebrew/.git/FETCH_HEAD: Permission denied
fatal: Unable to create '/usr/local/Homebrew/.git/index.lock': Permission denied
fatal: Unable to create '/usr/local/Homebrew/.git/index.lock': Permission denied
error: could not lock config file .git/config: Permission denied
==> Downloading https://homebrew.bintray.com/bottles/terragrunt-0.18.3.mojave.bottle.tar.gz
Already downloaded: /Users/rohithgundala/Library/Caches/Homebrew/downloads/f494cc7ebcfadf5e2610048e6c9f937e0151ff46cf0c226d83118e6d8ba704cc--terragrunt-0.18.3.mojave.bottle.tar.gz
==> Pouring terragrunt-0.18.3.mojave.bottle.tar.gz
  /usr/local/Cellar/terragrunt/0.18.3: 3 files, 19.6MB

选项2:

# Install Terragrunt
RUN wget -q -O ${BIN_DIR}/terragrunt "https://github.com/gruntwork-io/terragrunt/releases/download/v${TERRAGRUNT_VERSION}/terragrunt_linux _amd64" \
 && chmod +x ${BIN_DIR}/terragrunt

输出:

bin/terragrunt: cannot execute binary file
4

3 回答 3

1

按照https://brew.sh/中的说明安装 Homebrew 。

然后运行以下命令:

git clone https://github.com/cunymatthieu/tgenv.git /usr/local/Cellar/tgenv
ln -s /usr/local/Cellar/tgenv/bin/* /usr/local/bin
tgenv install 0.19.31
tfenv use 0.19.31

tgenv 是 Terragrunt 的版本管理器。https://github.com/cunymatthieu/tgenv/blob/master/README.md

当您需要在同一台机器上使用特定版本或多个版本时,它非常方便。

tfenv 是一个相关工具,对 terraform 命令执行相同操作:https ://github.com/tfutils/tfenv

于 2020-06-07T18:31:43.793 回答
0

对于较新版本的 Mac OS,内核是 Darwin,上面的答案不会出现以下错误:-

zsh: exec format error

请通过运行命令确认uname -a并下载特定于该内核“terragrunt_darwin_amd64”的文件以获取您想要的任何版本。

所以下面应该工作: -

wget -q -O /bin/terragrunt "https://github.com/gruntwork-io/terragrunt/releases/download/v0.xx.x/terragrunt_darwin_amd64"

chmod +x /bin/terragrunt

terragrunt -v
于 2020-06-07T14:23:11.720 回答
-1

我为此找到了答案。

wget -q -O /bin/terragrunt "https://github.com/gruntwork-io/terragrunt/releases/download/v0.xx.x/terragrunt_linux_amd64"

chmod +x /bin/terragrunt

 terragrunt -v
于 2019-09-09T20:23:49.827 回答