Giter Site home page Giter Site logo

robertpeteuil / hashicorp-installer Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 1.0 49 KB

Installer for HashiCorp binaries - automatic download, extract and install latest or specific version

License: Apache License 2.0

Shell 100.00%
automated-deployment automation bash-script hashicorp hashicorp-boundary hashicorp-consul hashicorp-downloads hashicorp-nomad hashicorp-packer hashicorp-sentinel

hashicorp-installer's Introduction

Installer for HashiCorp Binaries

Automate Download and Installation of HashiCorp binaries

release bash license


hci automates the process of downloading and installing HashiCorp products. It supports all binaries on releases.hashicorp.com; including terraform, packer, vault, consul, boundary, waypoint, etc..

This script searches releases, determines correct binary for the system, downloads binary and installs it to the selected location. It allows install of the most recent version of any product with only one parameter. There are many optional parameters which allow it to be used to query/validate version numbers, retrieve enterprise binaries, and specifying custom location for the downloaded binary.

Example, display the latest patch release for terraform 1.1: hci -i 1.1 -o

This is an upgrade and replacement for the earlier projects: Terraform Installer and Packer Installer. It has been designed for easy migration and allows drop-in-replacement with minimal adjustments.

Use

hci [-p PRODUCT] [-i VERSION] [-e] [-o] [-h] [-v] [-m] [-a] [-c] [-d]

     -p PRODUCT : product (default='terraform')
     -i VERSION : version (default=latest)
                  specify either product version (ex: '1.1') or specific release (ex: '1.1.9')
     -e         : download enterprise binary for PRODUCT = vault, consul or nomad
     -o         : only output release info (don't download, install)
     -h         : help
     -v         : display script version

     -m         : Mac - force Intel binary (ignore detection of Apple Silicon)
     -a         : automatically use sudo to install to /usr/local/bin (or $INSTALL_DIR env var)
     -c         : leave binary in current working directory
     -d         : debug output

     PRODUCT may specify product name or abbreviation
       product names : https://releases.hashicorp.com
       abbreviations : b=boundary, c=consul, n=nomad, p=packer, t=terraform, v=vault, w=waypoint

Download

Download latest release from my bootstrap server (iac.sh or https://iac.sh)

curl iac.sh/hci > hci
chmod +x hci
# optional - move to system binary directory
sudo mv hci /usr/local/bin

Download from GitHub

curl -LO https://raw.github.com/robertpeteuil/hashicorp-installer/master/hci
chmod +x hci

Parameters

Specifying Products -p

  • -p not specified, defaults to Terraform
    • hci
  • specify product abbreviation (v = vault)
    • hci -p v
  • specify full binary name
    • hci -p consul-template

Specifying Specific or Partial Versions -i

  • latest - don't specify -i
    • hci
  • specific version - use MAJOR.MINOR.PATCH format
    • hci -i 1.1.5
  • latest patch release - use MAJOR.MINOR format
    • hci -i 1.1

Output Only Mode -o

find latest version or patch release, display info and exit without install

  • display latest version of Terraform
    • hci -o
  • display latest patch release for Vault 1.9
    • hci -p v -i 1.9 -o

Override arm64 binaries on macOS -m

  • If installer detects Apple Silicon it attempts to install arm64 binaries
  • If arm64 binaries aren't available for a given product + version, it reverts to amd64 (Intel)
  • Force install of Intel binaries with -m flag
    • Useful for Terraform when using use older provider versions that lack an arm64 build
      • the terraform binary and provider binary need to share the same cpu architecture

Release Info

Migration from Previous Installers

  • macOS on Apple Silicon
    • behavior change from previous scripts when running on Apple Silicon Macs
      • installer looks for darwin_arm64 binaries when Apple Silicon is detected
      • previous installers assumed amd64 cpu on macOS
    • force old behavior (always use amd64 binaries), with the -m parameter
  • installing products other than terraform
    • use -p parameter specifying the product to install

System Requirements

  • System with Bash Shell (Linux, macOS, Windows Subsystem for Linux)
  • curl or wget - script will use either one to retrieve metadata and download
  • unzip - terraform downloads are in zip format

Disclaimer

I am a HashiCorp employee, but this is a personal project and not officially endorsed or supported by HashiCorp.

License

Apache 2.0 License - Copyright (c) 2024 Robert Peteuil

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.