Skip to content

Commit db3c74d

Browse files
Add documentation for Patcher (#763)
* Add documentation for Patcher * Update with Eugene's comments * Fix info block * Add sidebar + update PATH
1 parent d5435ee commit db3c74d

File tree

7 files changed

+178
-0
lines changed

7 files changed

+178
-0
lines changed
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
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+
![Patcher Report screenshot](/img/guides/stay-up-to-date/patcher/patcher-report.png)
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+
![Patcher Usages screenshot](/img/guides/stay-up-to-date/patcher/patcher-usages.png)
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+
![Patcher Changelogs screenshot](/img/guides/stay-up-to-date/patcher/patcher-changelogs.png)
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+
![Patcher Changelogs screenshot](/img/guides/stay-up-to-date/patcher/patcher-no-changelogs.png)
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+
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
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+
![Patcher Report screenshot](/img/guides/stay-up-to-date/patcher/patcher-report.png)
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+
![Patcher Usages screenshot](/img/guides/stay-up-to-date/patcher/patcher-usages.png)
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+
![Patcher Changelogs screenshot](/img/guides/stay-up-to-date/patcher/patcher-changelogs.png)
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+
![Patcher Changelogs screenshot](/img/guides/stay-up-to-date/patcher/patcher-no-changelogs.png)
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 -->

sidebars/update-guides.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,18 @@ const sidebars = {
246246
],
247247
},
248248
],
249+
patcher: [
250+
backLink,
251+
{
252+
label: "Keep up-to-date with Patcher",
253+
type: "category",
254+
link: {
255+
type: "doc",
256+
id: "guides/stay-up-to-date/patcher/index",
257+
},
258+
items: []
259+
}
260+
]
249261
}
250262

251263
module.exports = sidebars
640 KB
Loading
573 KB
Loading
784 KB
Loading
561 KB
Loading

0 commit comments

Comments
 (0)