Skip to content

Commit bf6f114

Browse files
Merge pull request #5 from robertpeteuil/dev
refine readme
2 parents 7c994af + 73b567a commit bf6f114

File tree

2 files changed

+56
-37
lines changed

2 files changed

+56
-37
lines changed

README.md

Lines changed: 53 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,21 @@
22

33
## Automate Download and Installation of HashiCorp binaries
44

5-
<!-- [![release](https://img.shields.io/badge/release-1.0.0--beta.2-2067b8)](https://github.com/robertpeteuil/hashicorp-installer) -->
65
[![release](https://img.shields.io/github/release/robertpeteuil/hashicorp-installer?colorB=2067b8)](https://github.com/robertpeteuil/hashicorp-installer)
76
[![bash](https://img.shields.io/badge/language-bash-89e051.svg?style=flat-square)](https://github.com/robertpeteuil/hashicorp-installer)
87
[![license](https://img.shields.io/github/license/robertpeteuil/hashicorp-installer?colorB=2067b8)](https://github.com/robertpeteuil/hashicorp-installer)
98

109
---
1110

12-
**hcinstall.sh** 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..
11+
**hcinstall.sh** automates the process of downloading and installing HashiCorp products. It supports all binaries on [releases.hashicorp.com](https://releases.hashicorp.com); including [terraform](https://www.terraform.io/), [packer](https://www.packer.io/), [vault](https://www.vaultproject.io/), [consul](https://www.consul.io/), [boundary](https://www.boundaryproject.io/), [waypoint](https://www.waypointproject.io/), etc..
1312

1413
This script detects host architecture, searches for releases, downloads, verifies and installs binaries. Optional parameters allow finding latest patch releases, retrieving enterprise binaries, and functioning in special modes.
1514

15+
It can also be used to display the latest patch release for a given version without installation (using output only mode). For example, find the latest release in the Terraform 1.1 series: `hcinstall.sh -i 1.1 -o`.
16+
1617
This is an upgrade and replacement for the earlier projects: [Terraform Installer](https://github.com/robertpeteuil/terraform-installer) and [Packer Installer](https://github.com/robertpeteuil/packer-installer). It has been designed for easy migration and allows drop-in-replacement with minimal adjustments.
1718

18-
## Usage
19+
## Use
1920

2021
```text
2122
hcinstall.sh [-p PRODUCT] [-i VERSION] [-e] [-o] [-h] [-v] [-m] [-a] [-c] [-d]
@@ -37,56 +38,74 @@ hcinstall.sh [-p PRODUCT] [-i VERSION] [-e] [-o] [-h] [-v] [-m] [-a] [-c] [-d]
3738
full names: https://releases.hashicorp.com
3839
```
3940

40-
### Examples
41+
## Download
42+
43+
Download latest release [^1] from my bootstrap server (iac.sh or https://iac.sh)
44+
45+
``` shell
46+
curl iac.sh/hcinstall > hcinstall.sh
47+
chmod +x hcinstall.sh
48+
```
49+
50+
Download from GitHub
51+
52+
``` shell
53+
curl -LO https://raw.github.com/robertpeteuil/hashicorp-installer/master/hcinstall.sh
54+
chmod +x hcinstall.sh
55+
```
56+
57+
[^1]: Releases automatically published to iac.sh via GitHub Actions
58+
59+
## Parameters
4160

42-
> specify product with `-p` flag
61+
### Specifying Products `-p`
4362

44-
- defaults to Terraform if `-p` not specified
63+
- `-p` not specified, defaults to Terraform
4564
- `hcinstall.sh`
46-
- install vault using product abbreviation
65+
- specify product abbreviation (v = vault)
4766
- `hcinstall.sh -p v`
48-
- install consul-template using name
67+
- specify full binary name
4968
- `hcinstall.sh -p consul-template`
5069

51-
> specify version with `-i` flag
70+
### Specifying Specific or Partial Versions `-i`
5271

53-
- install latest - don't specify version
72+
- latest - don't specify `-i`
5473
- `hcinstall.sh`
55-
- install specific version - use MAJOR.MINOR.PATCH format
74+
- specific version - use MAJOR.MINOR.PATCH format
5675
- `hcinstall.sh -i 1.1.5`
57-
- determine & install latest patch release - use MAJOR.MINOR format
76+
- latest patch release - use MAJOR.MINOR format
5877
- `hcinstall.sh -i 1.1`
5978

60-
### Override CPU detection on Apple Silicon (arm64)
79+
### Output Only Mode `-o`
6180

62-
> On macOS hosts with Apple Silicon (arm64)
81+
> find latest version or patch release, display info and exit without install
6382
64-
- by default, if installer detects Apple Silicon it attempts to install `arm64` binaries
65-
- If `arm64` binaries aren't available for a given product + version, it reverts to `amd64` (Intel)
66-
- To override detected CPU and force Intel binaries, use the `-m`
67-
- ex: when using terraform with an older version of a provider that isn't available for arm64
68-
- install the intel version of terraform with: `hcinstaller.sh -m`
83+
- display latest version of Terraform
84+
- `hcinstall.sh -o`
85+
- display latest patch release for Vault 1.9
86+
- `hcinstall.sh -p v -i 1.9 -o`
6987

70-
## Migration from Previous Installers
88+
## Override arm64 binaries on macOS `-m`
7189

72-
- macOS on Apple Silicon
73-
- previous installers assumed `amd64` cpu on macOS
74-
- This installer will look for `darwin_arm64` binaries when Apple Silicon is detected
75-
- If `darwin_arm64` binaries aren't available (for a given product/version), it reverts to Intel `darwin_amd64`
76-
- you can force the old behavior (always use `amd64` binaries), with the `-m` parameter
77-
- installing products other than terraform
78-
- when replacing a previous installer with this one, add the `-p` parameter specifying the product to install
90+
- If installer detects Apple Silicon it attempts to install `arm64` binaries
91+
- If `arm64` binaries aren't available for a given product + version, it reverts to `amd64` (Intel)
92+
- Force install of Intel binaries with `-m` flag
93+
- Useful for Terraform when using use older provider versions that lack an `arm64` build
94+
- the terraform binary and provider binary need to share the same cpu architecture
7995

80-
## Download and Use Locally
96+
## Release Info
8197

82-
Download Installer
98+
### Migration from Previous Installers
8399

84-
``` shell
85-
curl -LO https://raw.github.com/robertpeteuil/hashicorp-installer/master/hcinstall.sh
86-
chmod +x hcinstall.sh
87-
```
100+
- macOS on Apple Silicon
101+
- behavior change from previous scripts when running on Apple Silicon Macs
102+
- installer looks for `darwin_arm64` binaries when Apple Silicon is detected
103+
- previous installers assumed `amd64` cpu on macOS
104+
- force old behavior (always use `amd64` binaries), with the `-m` parameter
105+
- installing products other than terraform
106+
- use `-p` parameter specifying the product to install
88107

89-
## System Requirements
108+
### System Requirements
90109

91110
- System with Bash Shell (Linux, macOS, Windows Subsystem for Linux)
92111
- `curl` or `wget` - script will use either one to retrieve metadata and download

hcinstall.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ set -e
1414
# sudoInstall=true
1515
defaultProduct="terraform"
1616

17-
scriptname=$(basename "$0")
18-
scriptbuildnum="1.0.0-beta.3"
19-
scriptbuilddate="2022-10-26"
17+
scriptname="hcinstall"
18+
scriptbuildnum="1.0.0-beta.4"
19+
scriptbuilddate="2022-10-27"
2020

2121
# CHECK DEPENDANCIES AND SET NET RETRIEVAL TOOL
2222
if ! unzip -h 2&> /dev/null; then

0 commit comments

Comments
 (0)