Giter VIP home page Giter VIP logo

install-hashicorp-binaries's Introduction

Install HashiCorp binaries

GitHub release (latest SemVer)

Installation script for HashiCorp binaries hosted on https://releases.hashicorp.com (e.g. packer, terraform, vault).

Getting Started

Download the installtion script

Linux / MacOS:

curl -LO https://raw.github.com/ZEISS/install-hashicorp-binaries/master/install-hashicorp.sh
chmod +x install-hashicorp.sh

Windows:

Invoke-WebRequest -UseBasicParsing `
-Uri https://raw.github.com/ZEISS/install-hashicorp-binaries/master/install-hashicorp.ps1 `
-OutFile install-hashicorp.ps1

Prerequisities

MacOS:

Linux / MacOS:

  • bash for executing script
  • curl for fetching metadata and archive
  • unzip for extracting binary from archive
  • shasum / sha256sum for verifying archive checksum
  • gpg for verifying checksum signature (optional)

Windows:

  • powershell / pwsh for executing script
  • gpg for verifying checksum signature (optional)

Usage

Install the required HashiCorp binaries

Linux / MacOS:

# ./install-hashicorp.sh <name>[:<version>] [...]
./install-hashicorp.sh packer terraform:0.14.0-rc1 vault:latest

Windows:

# .\install-hashicorp.ps1 <name>[:<version>] [...]
.\install-hashicorp.ps1 packer terraform:0.14.0-rc1 vault:latest

Script Details

  • Determines pre-compiled binary archive based on
    • specified name
    • specified or latest stable version
    • detected operating system
    • detected CPU architecture
  • Verifies system requirements
  • Verifies and imports PGP key (optional)
  • Fetchs archive, checksums and signature files
  • Verifies checksum signature (optional)
  • Verifies archive checksum
  • Extract binary from archive
  • Verifies binary code signature (for MacOS and Windows)
  • Adds binary to system's PATH
    • Moves binary to /usr/local/bin (for Linux and MacOS)
    • Moves binary to ${env:ProgramW6432}\HashiCorp\bin (for Windows)
    • Adds ${env:ProgramW6432}\HashiCorp\bin to system's PATH (for Windows)
  • Cleans up archive, checksums and signature files
  • Verifies binary installation

Contributing

If you find issues, please register them at this GitHub project issue page or consider contributing code by following this guideline.

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details.

install-hashicorp-binaries's People

Contributors

coolduke avatar rembik avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

install-hashicorp-binaries's Issues

Support installation within user scope or defined directory

SUMMARY
  • Support installation within user scope or defined directory
  • Only install binary, if the current version mismatch
ISSUE TYPE
  • Feature Idea
ADDITIONAL INFORMATION
  1. Add script parameters and evaluate those to differentiate if the installation should be done in
  • system scope (default):
    • linux/macos: /usr/local/bin
    • windows: ${env:ProgramW6432}\HashiCorp\bin
  • user scope (option -u, --user):
    • linux/macos: ${HOME}/.local/bin
    • windows: ${env:LOCALAPPDATA}\HashiCorp\bin
  • custom directory (option -d, --directory PATH):
    • all: ${OPTARG} with support for relative paths depending on where the script was executed from

Only one installation scope should be used. If option -u and -d were set, the custom directory wins over user scope.

  1. Add check if a current exists and compare requested version with current one before installing (fetch/extract) binaries.
# ./install-hashicorp.sh [<option>] <name>[:<version>] [...]
./install-hashicorp.sh -u terraform
./install-hashicorp.sh -d ../ terraform

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.