Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
brikis98 committed May 9, 2016
1 parent ab92dcc commit fd4e92a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 24 deletions.
44 changes: 21 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

[Gruntwork Script Modules](https://github.com/gruntwork-io/script-modules) is a private repo that contains scripts and
applications developed by [Gruntwork](http://www.gruntwork.io) for common infrastructure tasks such as setting up
continuous integration, monitoring, log aggregation, and SSH access. This repo contains provides a script called
`gruntwork-install` that makes it as easy to install the Gruntwork Script Modules as using apt-get, brew, or yum.
continuous integration, monitoring, log aggregation, and SSH access. This repo provides a script called
`gruntwork-install` that makes it as easy to install a Script Module as using apt-get, brew, or yum.

For example, in your Packer and Docker templates, you can use `gruntwork-install` as follows:

Expand All @@ -14,7 +14,7 @@ gruntwork-install --module-name 'vault-ssh-helper' --tag '0.0.3'
## Installing gruntwork-install

```bash
curl -Ls https://raw.githubusercontent.com/gruntwork-io/gruntwork-installer/master/bootstrap-gruntwork-installer.sh | bash -s --version=0.0.1
curl -Ls https://raw.githubusercontent.com/gruntwork-io/gruntwork-installer/master/bootstrap-gruntwork-installer.sh | bash -s --version 0.0.1
```

Notice the `--version` parameter at the end where you specify which version of `gruntwork-install` to install. See the
Expand All @@ -31,32 +31,29 @@ Since the [Script Modules](https://github.com/gruntwork-io/script-modules) repo
environment variable `GITHUB_OAUTH_TOKEN` so `gruntwork-install` can use it to access the repo:

```bash
export GITHUB_OAUTH_TOKEN="..."
export GITHUB_OAUTH_TOKEN="(your secret token)"
```

#### Options

Once that environment variable is set, you can run `gruntwork-install` with the following options:

* `--module-name`: Required. The name of the Script Module to install. Can be any folder within the `modules` directory
of the [Script Modules Repo](https://github.com/gruntwork-io/script-modules).
* `--tag`: Required. The version of the Script Module to install. Follows the syntax described at [Fetch Version
Constraint Operators](https://github.com/gruntwork-io/fetch#version-constraint-operators).
* `--branch`: Optional. Download the latest commit from this branch. This is an alternative to `--tag` for development
purposes.
* `--module-param`: Optional. A key-value pair of the format `key=value` you wish to pass to the module as a parameter.
May be used multiple times. See the documentation for each module to find out what parameters it accepts.
* `--help`: Optional. Show the help text and exit.
Option | Required | Description
---------------- | -------- | ------------
`--module-name` | Yes | The name of the Script Module to install. Can be any folder within the `modules` directory of the [Script Modules Repo](https://github.com/gruntwork-io/script-modules).
`--tag` | Yes | The version of the Script Module to install. Follows the syntax described at [Fetch Version Constraint Operators](https://github.com/gruntwork-io/fetch#version-constraint-operators).
`--module-param` | No | A key-value pair of the format `key=value` you wish to pass to the module as a parameter. May be used multiple times. See the documentation for each module to find out what parameters it accepts.
`--help` | No | Show the help text and exit.

#### Examples

Here is how you could use `gruntwork-install` to install the `vault-ssh-helper` module, version `0.0.3`:
Install the `cloudwatch-log-aggregation` module version `0.0.3`:

```bash
gruntwork-install --module-name 'vault-ssh-helper' --tag '0.0.3'
gruntwork-install --module-name 'cloudwatch-log-aggregation' --tag '0.0.3'
```

And here is an example of using `--module-param` to pass two custom parameters to the `vault-ssh-helper` module:
Install the `vault-ssh-helper` module, passing two custom parameters to it:

```bash
gruntwork-install --module-name 'vault-ssh-helper' --tag '0.0.3' --module-param 'install-dir=/opt/vault-ssh-helper' --module-param 'owner=ubuntu'
Expand All @@ -80,7 +77,7 @@ and then uses it to install several modules:
}],
"provisioners": [{
"type": "shell",
"inline": "curl -Ls https://raw.githubusercontent.com/gruntwork-io/gruntwork-installer/master/bootstrap-gruntwork-installer.sh | bash -s --version=0.0.1"
"inline": "curl -Ls https://raw.githubusercontent.com/gruntwork-io/gruntwork-installer/master/bootstrap-gruntwork-installer.sh | bash -s --version 0.0.1"
},{
"type": "shell",
"inline": [
Expand Down Expand Up @@ -113,13 +110,14 @@ install process anyway, at which point manual inspection isn't a possibility any
#### Risk #2: The download URL could be hijacked for malicious code.

This is unlikely, as it is an https URL, and your download program (e.g. `curl`) should be verifying SSL certs. That
said, Certificate Authorities have been hacked in the past, and if that is a major concern for you, feel free to copy
the bootstrap code into your own codebase and execute it from there.
said, Certificate Authorities have been hacked in the past, and perhaps the Gruntwork GitHub account could be hacked
in the future, so if that is a major concern for you, feel free to copy the bootstrap code into your own codebase and
execute it from there.

#### Risk #3: The script may not download fully and executing it could cause catastrophic errors.
#### Risk #3: The script may not download fully and executing it could cause errors.

We wrote our bootstrap script as a series of bash functions that are only executed by the very last line of the script.
Therefore, if the script doesn't fully download, the worst that'll happen when you execute it is a harmless syntax
error.
We wrote our [bootstrap-gruntwork-installer.sh](bootstrap-gruntwork-installer.sh) as a series of bash functions that
are only executed by the very last line of the script. Therefore, if the script doesn't fully download, the worst
that'll happen when you execute it is a harmless syntax error.


2 changes: 1 addition & 1 deletion bootstrap-gruntwork-installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#
# So instead, we recommend that clients use this tiny bootstrap script as a one-liner:
#
# curl -Ls https://raw.githubusercontent.com/gruntwork-io/gruntwork-installer/master/bootstrap-gruntwork-installer.sh | bash -s --version=0.0.12
# curl -Ls https://raw.githubusercontent.com/gruntwork-io/gruntwork-installer/master/bootstrap-gruntwork-installer.sh | bash -s --version 0.0.12
#
# You can copy this one-liner into your Packer and Docker templates and immediately after, start using the
# gruntwork-install command.
Expand Down

0 comments on commit fd4e92a

Please sign in to comment.