From 7809f5da3ea932864314b75d9ade6bdab41b7b5e Mon Sep 17 00:00:00 2001 From: techpink <7670638+techpink@users.noreply.github.com> Date: Thu, 3 Aug 2023 12:23:04 +0200 Subject: [PATCH 1/6] Added non-interactive mode --- .../patcher/running-patcher/report.md | 34 ++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/_docs-sources/patcher/running-patcher/report.md b/_docs-sources/patcher/running-patcher/report.md index 0edcc1ed5f..a31d6babf9 100644 --- a/_docs-sources/patcher/running-patcher/report.md +++ b/_docs-sources/patcher/running-patcher/report.md @@ -1,5 +1,17 @@ # Patcher Report +Starting in `0.4.2`, Patcher supports two modes: **interactive mode** and **non-interactive mode**. + +In interactive mode, the user can browse the discovered module dependencies. + +In non-interactive mode, Patcher outputs a list of module dependencies in JSON format. + +## Interactive Mode (Default) +Example usage: +``` +patcher report prod +``` + The `patcher report` command is a read-only version of Patcher that shows the changelog per module and its usages. After scanning for dependencies, Patcher will show you the 'Modules View', similar to the screenshot below. @@ -20,4 +32,24 @@ Some modules including third party modules may not have a CHANGELOGS.md file. In ![Patcher no changelogs screenshot](/img/guides/stay-up-to-date/patcher/patcher-report-no-changelog.png) - +## Non-Interactive Mode +Example usage: +``` +patcher report --non-interactive prod +``` + +The report command outpust a list of module dependencies in JSON format to `stdout`, for example: +```json +[ + "gruntwork-io/terraform-aws-monitoring/logs/load-balancer-access-logs", + "gruntwork-io/terraform-aws-service-catalog/services/k8s-service", + "gruntwork-io/terraform-aws-messaging/sqs", + "gruntwork-io/terraform-aws-service-catalog/services/k8s-namespace", + "gruntwork-io/terraform-aws-cis-service-catalog/networking/vpc", + "gruntwork-io/terraform-aws-security/custom-iam-entity", + "gruntwork-io/terraform-aws-utilities/request-quota-increase", + "gruntwork-io/terraform-aws-service-catalog/networking/sns-topics", + "gruntwork-io/terraform-aws-cis-service-catalog/landingzone/account-baseline-app", + "gruntwork-io/terraform-aws-service-catalog/networking/route53" +] +``` From 23dc8d0fd28e03aed13a1e06e22b8f751d2e85cf Mon Sep 17 00:00:00 2001 From: techpink <7670638+techpink@users.noreply.github.com> Date: Thu, 3 Aug 2023 12:59:35 +0200 Subject: [PATCH 2/6] Added Docker requirment --- .../patcher/running-patcher/update.md | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/_docs-sources/patcher/running-patcher/update.md b/_docs-sources/patcher/running-patcher/update.md index 8bbd1ab772..e76da819b4 100644 --- a/_docs-sources/patcher/running-patcher/update.md +++ b/_docs-sources/patcher/running-patcher/update.md @@ -2,7 +2,15 @@ The Patcher update command allows you to update some or all of the module dependencies in the current folder and any child folders. -The update command supports two modes: **interactive mode** and **non-interactive mode**. +:::info + +Starting in `0.4.1`, Patcher applies patches using a Docker sandbox by default and will pull the latest version of the [`gruntwork/patcher_bash_env`](https://hub.docker.com/r/gruntwork/patcher_bash_env) image. + +To run Patcher in a CI pipeline you should add the `--skip-container-runtime` flag. + +::: + +Patcher supports two modes: **interactive mode** and **non-interactive mode**. ## Interactive Mode @@ -57,6 +65,12 @@ Some modules including third party modules may not have a CHANGELOGS.md file. In In non-interactive mode, Patcher updates all module dependencies in the current folder (and child folders) according to the specified update strategy. +:::caution + +Starting in `0.4.1`, Patcher applies patches using a Docker sandbox by default. To run Patcher in a CI pipeline you should add the `--skip-container-runtime` flag. + +::: + Non-interactive mode supports both the `next-safe` and `next-breaking` update strategies. ### Next Safe (Default) @@ -65,11 +79,11 @@ Using the [next safe update strategy](/patcher/update-strategies#next-safe-updat Example usage: ``` -patcher update --non-interactive --update-strategy next-safe +patcher update --non-interactive --skip-container-runtime --update-strategy next-safe prod ``` Or just ``` -patcher update --non-interactive +patcher update --non-interactive --skip-container-runtime prod ``` ### Next Breaking @@ -80,7 +94,7 @@ If Patcher updates a dependency to a breaking version, a `README-TO-COMPLETE-UPD Example usage: ``` -patcher update --non-interactive --update-strategy next-breaking +patcher update --non-interactive --skip-container-runtime --update-strategy next-breaking prod ``` ## Support for Third Party Modules From 9beeec5e7cce39f469949f7eae90bb5723d31cdb Mon Sep 17 00:00:00 2001 From: techpink <7670638+techpink@users.noreply.github.com> Date: Thu, 3 Aug 2023 13:00:27 +0200 Subject: [PATCH 3/6] Generated files --- docs/patcher/running-patcher/report.md | 36 ++++++++++++++++++++++++-- docs/patcher/running-patcher/update.md | 24 +++++++++++++---- 2 files changed, 53 insertions(+), 7 deletions(-) diff --git a/docs/patcher/running-patcher/report.md b/docs/patcher/running-patcher/report.md index 2adfb27c09..23de8c355c 100644 --- a/docs/patcher/running-patcher/report.md +++ b/docs/patcher/running-patcher/report.md @@ -1,5 +1,17 @@ # Patcher Report +Starting in `0.4.2`, Patcher supports two modes: **interactive mode** and **non-interactive mode**. + +In interactive mode, the user can browse the discovered module dependencies. + +In non-interactive mode, Patcher outputs a list of module dependencies in JSON format. + +## Interactive Mode (Default) +Example usage: +``` +patcher report prod +``` + The `patcher report` command is a read-only version of Patcher that shows the changelog per module and its usages. After scanning for dependencies, Patcher will show you the 'Modules View', similar to the screenshot below. @@ -20,12 +32,32 @@ Some modules including third party modules may not have a CHANGELOGS.md file. In ![Patcher no changelogs screenshot](/img/guides/stay-up-to-date/patcher/patcher-report-no-changelog.png) - +## Non-Interactive Mode +Example usage: +``` +patcher report --non-interactive prod +``` + +The report command outpust a list of module dependencies in JSON format to `stdout`, for example: +```json +[ + "gruntwork-io/terraform-aws-monitoring/logs/load-balancer-access-logs", + "gruntwork-io/terraform-aws-service-catalog/services/k8s-service", + "gruntwork-io/terraform-aws-messaging/sqs", + "gruntwork-io/terraform-aws-service-catalog/services/k8s-namespace", + "gruntwork-io/terraform-aws-cis-service-catalog/networking/vpc", + "gruntwork-io/terraform-aws-security/custom-iam-entity", + "gruntwork-io/terraform-aws-utilities/request-quota-increase", + "gruntwork-io/terraform-aws-service-catalog/networking/sns-topics", + "gruntwork-io/terraform-aws-cis-service-catalog/landingzone/account-baseline-app", + "gruntwork-io/terraform-aws-service-catalog/networking/route53" +] +``` diff --git a/docs/patcher/running-patcher/update.md b/docs/patcher/running-patcher/update.md index 8903f59e27..df7d999fe1 100644 --- a/docs/patcher/running-patcher/update.md +++ b/docs/patcher/running-patcher/update.md @@ -2,7 +2,15 @@ The Patcher update command allows you to update some or all of the module dependencies in the current folder and any child folders. -The update command supports two modes: **interactive mode** and **non-interactive mode**. +:::info + +Starting in `0.4.1`, Patcher applies patches using a Docker sandbox by default and will pull the latest version of the [`gruntwork/patcher_bash_env`](https://hub.docker.com/r/gruntwork/patcher_bash_env) image. + +To run Patcher in a CI pipeline you should add the `--skip-container-runtime` flag. + +::: + +Patcher supports two modes: **interactive mode** and **non-interactive mode**. ## Interactive Mode @@ -57,6 +65,12 @@ Some modules including third party modules may not have a CHANGELOGS.md file. In In non-interactive mode, Patcher updates all module dependencies in the current folder (and child folders) according to the specified update strategy. +:::caution + +Starting in `0.4.1`, Patcher applies patches using a Docker sandbox by default. To run Patcher in a CI pipeline you should add the `--skip-container-runtime` flag. + +::: + Non-interactive mode supports both the `next-safe` and `next-breaking` update strategies. ### Next Safe (Default) @@ -65,11 +79,11 @@ Using the [next safe update strategy](/patcher/update-strategies#next-safe-updat Example usage: ``` -patcher update --non-interactive --update-strategy next-safe +patcher update --non-interactive --skip-container-runtime --update-strategy next-safe prod ``` Or just ``` -patcher update --non-interactive +patcher update --non-interactive --skip-container-runtime prod ``` ### Next Breaking @@ -80,7 +94,7 @@ If Patcher updates a dependency to a breaking version, a `README-TO-COMPLETE-UPD Example usage: ``` -patcher update --non-interactive --update-strategy next-breaking +patcher update --non-interactive --skip-container-runtime --update-strategy next-breaking prod ``` ## Support for Third Party Modules @@ -106,6 +120,6 @@ Patcher cannot update from `4.0.x` to `5.0.0` and will instead show a `?` in the From b2b1b508e0df31a57d4ed1456583c1e17c3c91b8 Mon Sep 17 00:00:00 2001 From: techpink <7670638+techpink@users.noreply.github.com> Date: Thu, 3 Aug 2023 13:39:52 +0200 Subject: [PATCH 4/6] Updated Docker text --- _docs-sources/patcher/index.md | 7 +++++-- _docs-sources/patcher/running-patcher/update.md | 6 ++++-- docs/patcher/index.md | 9 ++++++--- docs/patcher/running-patcher/update.md | 8 +++++--- 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/_docs-sources/patcher/index.md b/_docs-sources/patcher/index.md index 71ca19ff2d..0bda3f4e65 100644 --- a/_docs-sources/patcher/index.md +++ b/_docs-sources/patcher/index.md @@ -29,10 +29,13 @@ To fetch information from GitHub, Patcher requires a [GitHub Personal Access Tok export GITHUB_OAUTH_TOKEN="" ``` +Starting in `0.4.1`, the Patcher update command applies patches using a Docker sandbox by default and will pull the latest version of the [`gruntwork/patcher_bash_env`](https://hub.docker.com/r/gruntwork/patcher_bash_env) image. + +To run the Patcher update command locally without Docker or in a CI pipeline you should add the `--skip-container-runtime` flag. + ## Running Patcher -Patcher should be run in a local Terraform or Terragrunt Git repo. It will analyze _all_ modules that belong to the current folder -including its children. Patcher supports `source` values only from GitHub. +Patcher should be run in a local Terraform or Terragrunt Git repo. It will analyze _all_ modules that belong to the current folder including its children. Patcher supports `source` values only from GitHub. 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`. diff --git a/_docs-sources/patcher/running-patcher/update.md b/_docs-sources/patcher/running-patcher/update.md index e76da819b4..5908c3dc0a 100644 --- a/_docs-sources/patcher/running-patcher/update.md +++ b/_docs-sources/patcher/running-patcher/update.md @@ -6,7 +6,7 @@ The Patcher update command allows you to update some or all of the module depend Starting in `0.4.1`, Patcher applies patches using a Docker sandbox by default and will pull the latest version of the [`gruntwork/patcher_bash_env`](https://hub.docker.com/r/gruntwork/patcher_bash_env) image. -To run Patcher in a CI pipeline you should add the `--skip-container-runtime` flag. +To run Patcher locally without Docker or in a CI pipeline you should add the `--skip-container-runtime` flag. ::: @@ -67,7 +67,9 @@ In non-interactive mode, Patcher updates all module dependencies in the current :::caution -Starting in `0.4.1`, Patcher applies patches using a Docker sandbox by default. To run Patcher in a CI pipeline you should add the `--skip-container-runtime` flag. +Starting in `0.4.1`, Patcher applies patches using a Docker sandbox by default. + +To run Patcher in a CI pipeline you should add the `--skip-container-runtime` flag. ::: diff --git a/docs/patcher/index.md b/docs/patcher/index.md index 171304ffc8..4404985c38 100644 --- a/docs/patcher/index.md +++ b/docs/patcher/index.md @@ -29,10 +29,13 @@ To fetch information from GitHub, Patcher requires a [GitHub Personal Access Tok export GITHUB_OAUTH_TOKEN="" ``` +Starting in `0.4.1`, the Patcher update command applies patches using a Docker sandbox by default and will pull the latest version of the [`gruntwork/patcher_bash_env`](https://hub.docker.com/r/gruntwork/patcher_bash_env) image. + +To run the Patcher update command locally without Docker or in a CI pipeline you should add the `--skip-container-runtime` flag. + ## Running Patcher -Patcher should be run in a local Terraform or Terragrunt Git repo. It will analyze _all_ modules that belong to the current folder -including its children. Patcher supports `source` values only from GitHub. +Patcher should be run in a local Terraform or Terragrunt Git repo. It will analyze _all_ modules that belong to the current folder including its children. Patcher supports `source` values only from GitHub. 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`. @@ -55,6 +58,6 @@ patcher report --loglevel debug diff --git a/docs/patcher/running-patcher/update.md b/docs/patcher/running-patcher/update.md index df7d999fe1..6ac0e37d98 100644 --- a/docs/patcher/running-patcher/update.md +++ b/docs/patcher/running-patcher/update.md @@ -6,7 +6,7 @@ The Patcher update command allows you to update some or all of the module depend Starting in `0.4.1`, Patcher applies patches using a Docker sandbox by default and will pull the latest version of the [`gruntwork/patcher_bash_env`](https://hub.docker.com/r/gruntwork/patcher_bash_env) image. -To run Patcher in a CI pipeline you should add the `--skip-container-runtime` flag. +To run Patcher locally without Docker or in a CI pipeline you should add the `--skip-container-runtime` flag. ::: @@ -67,7 +67,9 @@ In non-interactive mode, Patcher updates all module dependencies in the current :::caution -Starting in `0.4.1`, Patcher applies patches using a Docker sandbox by default. To run Patcher in a CI pipeline you should add the `--skip-container-runtime` flag. +Starting in `0.4.1`, Patcher applies patches using a Docker sandbox by default. + +To run Patcher in a CI pipeline you should add the `--skip-container-runtime` flag. ::: @@ -120,6 +122,6 @@ Patcher cannot update from `4.0.x` to `5.0.0` and will instead show a `?` in the From 8d53255b9985f144d98848079171ea56911cc4f3 Mon Sep 17 00:00:00 2001 From: techpink <7670638+techpink@users.noreply.github.com> Date: Thu, 3 Aug 2023 13:48:38 +0200 Subject: [PATCH 5/6] Added titles --- _docs-sources/patcher/index.md | 4 ++++ docs/patcher/index.md | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/_docs-sources/patcher/index.md b/_docs-sources/patcher/index.md index 0bda3f4e65..a302180381 100644 --- a/_docs-sources/patcher/index.md +++ b/_docs-sources/patcher/index.md @@ -22,6 +22,8 @@ $ mv patcher /usr/local/bin ## Before Running Patcher +### GitHub Personal Access Token + 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 `GITHUB_OAUTH_TOKEN` environment variable to your GitHub Personal Access token: @@ -29,6 +31,8 @@ To fetch information from GitHub, Patcher requires a [GitHub Personal Access Tok export GITHUB_OAUTH_TOKEN="" ``` +### Docker + Starting in `0.4.1`, the Patcher update command applies patches using a Docker sandbox by default and will pull the latest version of the [`gruntwork/patcher_bash_env`](https://hub.docker.com/r/gruntwork/patcher_bash_env) image. To run the Patcher update command locally without Docker or in a CI pipeline you should add the `--skip-container-runtime` flag. diff --git a/docs/patcher/index.md b/docs/patcher/index.md index 4404985c38..941e4164b4 100644 --- a/docs/patcher/index.md +++ b/docs/patcher/index.md @@ -22,6 +22,8 @@ $ mv patcher /usr/local/bin ## Before Running Patcher +### GitHub Personal Access Token + 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 `GITHUB_OAUTH_TOKEN` environment variable to your GitHub Personal Access token: @@ -29,6 +31,8 @@ To fetch information from GitHub, Patcher requires a [GitHub Personal Access Tok export GITHUB_OAUTH_TOKEN="" ``` +### Docker + Starting in `0.4.1`, the Patcher update command applies patches using a Docker sandbox by default and will pull the latest version of the [`gruntwork/patcher_bash_env`](https://hub.docker.com/r/gruntwork/patcher_bash_env) image. To run the Patcher update command locally without Docker or in a CI pipeline you should add the `--skip-container-runtime` flag. @@ -58,6 +62,6 @@ patcher report --loglevel debug From d5e5b9348c4ade730d2c86f390dcf79a078d5997 Mon Sep 17 00:00:00 2001 From: techpink <7670638+techpink@users.noreply.github.com> Date: Thu, 3 Aug 2023 13:56:10 +0200 Subject: [PATCH 6/6] Moved info/caution boxes --- _docs-sources/patcher/running-patcher/update.md | 8 ++++---- docs/patcher/running-patcher/update.md | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/_docs-sources/patcher/running-patcher/update.md b/_docs-sources/patcher/running-patcher/update.md index 5908c3dc0a..08bec44f63 100644 --- a/_docs-sources/patcher/running-patcher/update.md +++ b/_docs-sources/patcher/running-patcher/update.md @@ -1,7 +1,5 @@ # Patcher Update -The Patcher update command allows you to update some or all of the module dependencies in the current folder and any child folders. - :::info Starting in `0.4.1`, Patcher applies patches using a Docker sandbox by default and will pull the latest version of the [`gruntwork/patcher_bash_env`](https://hub.docker.com/r/gruntwork/patcher_bash_env) image. @@ -10,6 +8,8 @@ To run Patcher locally without Docker or in a CI pipeline you should add the `-- ::: +The Patcher update command allows you to update some or all of the module dependencies in the current folder and any child folders. + Patcher supports two modes: **interactive mode** and **non-interactive mode**. ## Interactive Mode @@ -63,8 +63,6 @@ Some modules including third party modules may not have a CHANGELOGS.md file. In ## Non-Interactive Mode -In non-interactive mode, Patcher updates all module dependencies in the current folder (and child folders) according to the specified update strategy. - :::caution Starting in `0.4.1`, Patcher applies patches using a Docker sandbox by default. @@ -73,6 +71,8 @@ To run Patcher in a CI pipeline you should add the `--skip-container-runtime` fl ::: +In non-interactive mode, Patcher updates all module dependencies in the current folder (and child folders) according to the specified update strategy. + Non-interactive mode supports both the `next-safe` and `next-breaking` update strategies. ### Next Safe (Default) diff --git a/docs/patcher/running-patcher/update.md b/docs/patcher/running-patcher/update.md index 6ac0e37d98..29a73e26b3 100644 --- a/docs/patcher/running-patcher/update.md +++ b/docs/patcher/running-patcher/update.md @@ -1,7 +1,5 @@ # Patcher Update -The Patcher update command allows you to update some or all of the module dependencies in the current folder and any child folders. - :::info Starting in `0.4.1`, Patcher applies patches using a Docker sandbox by default and will pull the latest version of the [`gruntwork/patcher_bash_env`](https://hub.docker.com/r/gruntwork/patcher_bash_env) image. @@ -10,6 +8,8 @@ To run Patcher locally without Docker or in a CI pipeline you should add the `-- ::: +The Patcher update command allows you to update some or all of the module dependencies in the current folder and any child folders. + Patcher supports two modes: **interactive mode** and **non-interactive mode**. ## Interactive Mode @@ -63,8 +63,6 @@ Some modules including third party modules may not have a CHANGELOGS.md file. In ## Non-Interactive Mode -In non-interactive mode, Patcher updates all module dependencies in the current folder (and child folders) according to the specified update strategy. - :::caution Starting in `0.4.1`, Patcher applies patches using a Docker sandbox by default. @@ -73,6 +71,8 @@ To run Patcher in a CI pipeline you should add the `--skip-container-runtime` fl ::: +In non-interactive mode, Patcher updates all module dependencies in the current folder (and child folders) according to the specified update strategy. + Non-interactive mode supports both the `next-safe` and `next-breaking` update strategies. ### Next Safe (Default) @@ -122,6 +122,6 @@ Patcher cannot update from `4.0.x` to `5.0.0` and will instead show a `?` in the