From e1d5b7c5f40bc8a3e5ffb7dfda354a9a45d47e66 Mon Sep 17 00:00:00 2001
From: Timo Furrer <tfurrer@gitlab.com>
Date: Tue, 13 Feb 2024 07:57:37 +0100
Subject: [PATCH] Add section to README for how to install additional tools

---
 .gitlab/README.md.template | 21 +++++++++++++++++++++
 README.md                  | 21 +++++++++++++++++++++
 2 files changed, 42 insertions(+)

diff --git a/.gitlab/README.md.template b/.gitlab/README.md.template
index efbaf4b..90ed49b 100644
--- a/.gitlab/README.md.template
+++ b/.gitlab/README.md.template
@@ -181,6 +181,27 @@ Have a look at the individual template spec to learn about the available inputs.
 Have a look at the [`src/gitlab-tofu.sh`](src/gitlab-tofu.sh) script and how the `TF_`-prefixed
 variables are being used. You may set them according to your needs.
 
+### Install additional tools
+
+The `gitlab-opentofu` container image deliberately comes with minimal tooling
+to keep the image size small and be the least common denominator for our users.
+
+However, it is sometimes necessary to install additional tools. To do that you
+can overwrite the included jobs with a `before_script` entry. The `gitlab-opentofu`
+image uses `alpine` as its base image and therefore `apk` can be used to install
+the tools. For example to install `jq`:
+
+```yaml
+include:
+  - component: gitlab.com/components/opentofu/validate-plan@<VERSION>
+    inputs:
+      version: <VERSION>
+      opentofu_version: 1.6.1
+
+plan:
+  before_script:
+    - apk add jq
+```
 
 ## Releases & Versioning
 
diff --git a/README.md b/README.md
index 249c6e2..3de30a3 100644
--- a/README.md
+++ b/README.md
@@ -202,6 +202,27 @@ The following OpenTofu versions are available with this component via the `opent
 Have a look at the [`src/gitlab-tofu.sh`](src/gitlab-tofu.sh) script and how the `TF_`-prefixed
 variables are being used. You may set them according to your needs.
 
+### Install additional tools
+
+The `gitlab-opentofu` container image deliberately comes with minimal tooling
+to keep the image size small and be the least common denominator for our users.
+
+However, it is sometimes necessary to install additional tools. To do that you
+can overwrite the included jobs with a `before_script` entry. The `gitlab-opentofu`
+image uses `alpine` as its base image and therefore `apk` can be used to install
+the tools. For example to install `jq`:
+
+```yaml
+include:
+  - component: gitlab.com/components/opentofu/validate-plan@<VERSION>
+    inputs:
+      version: <VERSION>
+      opentofu_version: 1.6.1
+
+plan:
+  before_script:
+    - apk add jq
+```
 
 ## Releases & Versioning
 
-- 
GitLab