|
| 1 | +# Patcher |
| 2 | + |
| 3 | +## Installation |
| 4 | + |
| 5 | +To install Patcher, download the appropriate package for your system from the [releases](https://github.com/gruntwork-io/patcher-cli/releases) page. |
| 6 | + |
| 7 | +### For MacOS and Linux users |
| 8 | + |
| 9 | +Patcher runs as a single binary called `patcher`. Make sure it's available within your `PATH`. |
| 10 | + |
| 11 | +1. After downloading Patcher, move it to your desired destination directory. If you're using MacOS, you will have to unzip the package. For other operating systems, the artifact you download is the executable itself. |
| 12 | +2. If necessary, rename the binary to `patcher`. |
| 13 | +```bash |
| 14 | +mv patcher_linux_amd64 patcher |
| 15 | +``` |
| 16 | +3. Move `patcher` to a location available in your `PATH`. In the example below, we move to `/usr-local/bin`. |
| 17 | +```bash |
| 18 | +$ echo $PATH |
| 19 | +/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/Library/Apple/usr/bin:/Users/grunty/bin:/Users/grunty/go/bin |
| 20 | +$ mv patcher /usr/local/bin |
| 21 | +``` |
| 22 | + |
| 23 | +## Before Running Patcher |
| 24 | + |
| 25 | +To fetch information from GitHub, Patcher requires a [GitHub Personal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token), with the `repo` scope. Set the |
| 26 | +`GITHUB_OAUTH_TOKEN` environment variable to your GitHub Personal Access token: |
| 27 | + |
| 28 | +```bash |
| 29 | +export GITHUB_OAUTH_TOKEN="<YOUR_GITHUB_PAT>" |
| 30 | +``` |
| 31 | + |
| 32 | +## Running Patcher |
| 33 | + |
| 34 | +Patcher should be run in a local Terraform or Terragrunt Git repo. It will analyze _all_ modules that belong to the current folder |
| 35 | +including its children. Patcher supports `source` values only from GitHub. |
| 36 | + |
| 37 | +If you purchased and deployed our [Reference Architecture](https://gruntwork.io/reference-architecture/) and have your deployment organized in an `infrastructure-live` repository, we recommend running Patcher inside each environment folder, e.g. `infrastructure-live/dev`. |
| 38 | + |
| 39 | +### Patcher Report |
| 40 | + |
| 41 | +In `v0.2.x`, the only available command is `patcher report`. This is a read-only version of Patcher that shows the changelog per module and its usages. After running patcher report you will end up in the 'Modules View', similar to the screenshot below. |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | +#### Navigation commands |
| 46 | + |
| 47 | +1. While in the modules view, press `u` to see the usages. It shows all places where module is being used: |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | +2. While in the modules view, press `v` to see the changelogs from a module. Press `o` to open the page in the browser. |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | +:::info |
| 57 | +Some modules do not have a CHANGELOGS.md file. In this case, press `o` to open the releases page for that repository. |
| 58 | + |
| 59 | +::: |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | +### CIS AWS v1.5 Upgrade |
| 65 | + |
| 66 | +In `v0.1.x`, the only command available is `patcher upgrade cis`. This will upgrade your service catalogs to the latest |
| 67 | +module versions in the context of CIS v1.5. |
| 68 | + |
| 69 | +For the CIS AWS Foundations Benchmark v1.5 upgrade, refer to [the upgrade guide](https://docs.gruntwork.io/guides/stay-up-to-date/cis/cis-1.5.0/). |
| 70 | + |
| 71 | + |
| 72 | +## Debugging |
| 73 | + |
| 74 | +All logs are stored in the folder `~/.patcher/logs`. To also send `debug` logs, run Patcher with the `--loglevel debug` flag. |
| 75 | + |
| 76 | +``` |
| 77 | +patcher report --loglevel debug |
| 78 | +``` |
| 79 | + |
| 80 | + |
| 81 | + |
| 82 | +<!-- ##DOCS-SOURCER-START |
| 83 | +{ |
| 84 | + "sourcePlugin": "local-copier", |
| 85 | + "hash": "4a74320615308a335a61a9533cd6c73f" |
| 86 | +} |
| 87 | +##DOCS-SOURCER-END --> |
0 commit comments