From f7ff5040fa24a49de676a592d5ad2aa3a7406721 Mon Sep 17 00:00:00 2001 From: Gavin Bunney <409207+gavinbunney@users.noreply.github.com> Date: Fri, 17 Jul 2020 22:04:56 -0700 Subject: [PATCH] Added one-liner installer to docs --- docusaurus/docs/provider.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/docusaurus/docs/provider.md b/docusaurus/docs/provider.md index 1919bb1..fa27e2e 100755 --- a/docusaurus/docs/provider.md +++ b/docusaurus/docs/provider.md @@ -9,7 +9,22 @@ unlocks the power of terraform to manage your self-hosted Bitbucket Server insta ## Provider Installation -Download a binary for your system from the [release page](https://github.com/gavinbunney/terraform-provider-bitbucketserver/releases) and remove the `-os-arch` details so you're left with `terraform-provider-bitbucketserver`. + +### Install latest version + +The following one-liner script will fetch the latest provider version and download it to your `~/.terraform.d/plugins` directory. + +```bash +$ mkdir -p ~/.terraform.d/plugins && \ + curl -Ls https://api.github.com/repos/gavinbunney/terraform-provider-bitbucketserver/releases/latest \ + | jq -r ".assets[] | select(.browser_download_url | contains(\"$(uname -s | tr A-Z a-z)\")) | select(.browser_download_url | contains(\"amd64\")) | .browser_download_url" \ + | xargs -n 1 curl -Lo ~/.terraform.d/plugins/terraform-provider-bitbucketserver && \ + chmod +x ~/.terraform.d/plugins/terraform-provider-bitbucketserver +``` + +### Install manually + +If you don't want to use the one-liner above, you can download a binary for your system from the [release page](https://github.com/gavinbunney/terraform-provider-bitbucketserver/releases) and remove the `-os-arch` details so you're left with `terraform-provider-bitbucketserver`. Use `chmod +x` to make it executable and then either place it at the root of your Terraform folder or in the Terraform plugin folder on your system. ## Provider Configuration