From 5e53d4244bb016d920dc937fcdd49c90113393fc Mon Sep 17 00:00:00 2001 From: Pedro Rodrigues Date: Mon, 22 Jul 2024 19:18:38 -0300 Subject: [PATCH] Add image for `tf` ecosystem (#22) * Add image for `terragrunt` * Repurposing pull request to `tf` ecosystem --------- Co-authored-by: Pedro Rodrigues --- .github/workflows/tf.yml | 41 ++++++++++++++++++++++++++++++++++++++++ README.md | 1 + tf/.gitignore | 3 +++ tf/README.md | 13 +++++++++++++ tf/Taskfile.yml | 7 +++++++ tf/tf.apko.yaml | 24 +++++++++++++++++++++++ 6 files changed, 89 insertions(+) create mode 100644 .github/workflows/tf.yml create mode 100644 tf/.gitignore create mode 100644 tf/README.md create mode 100644 tf/Taskfile.yml create mode 100644 tf/tf.apko.yaml diff --git a/.github/workflows/tf.yml b/.github/workflows/tf.yml new file mode 100644 index 0000000..76a5272 --- /dev/null +++ b/.github/workflows/tf.yml @@ -0,0 +1,41 @@ +name: tf +on: + schedule: + - cron: '0 0 * * *' + push: + branches: + - main + paths: + - '.github/workflows/_shared**' + - '.github/workflows/tf.yml' + - 'tf/**' + pull_request: + paths: + - '.github/workflows/_shared**' + - '.github/workflows/tf.yml' + - 'tf/**' + workflow_dispatch: +jobs: + build: + if: github.event_name == 'pull_request' + uses: ./.github/workflows/_shared_build.yml + with: + owner: ${{ github.repository_owner }} + image: tf + version: pr-${{ github.event.pull_request.head.sha }} + publish: + permissions: + actions: read + contents: read + id-token: write + packages: write + if: github.event_name != 'pull_request' + uses: ./.github/workflows/_shared_publish.yml + with: + owner: ${{ github.repository_owner }} + image: tf + version: 1.${{ github.run_number }}.${{ github.run_attempt }} + revision: ${{ github.sha }} + secrets: + dh_token: ${{ secrets.DOCKERHUB_TOKEN }} + gcr_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index 647b36b..bac5488 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ - [prettier](./prettier) - [shellcheck](./shellcheck) - [shfmt](./shfmt) +- [tf](./tf) ## Development diff --git a/tf/.gitignore b/tf/.gitignore new file mode 100644 index 0000000..b5e6402 --- /dev/null +++ b/tf/.gitignore @@ -0,0 +1,3 @@ +*.tar +*.cdx +*.json diff --git a/tf/README.md b/tf/README.md new file mode 100644 index 0000000..9479e82 --- /dev/null +++ b/tf/README.md @@ -0,0 +1,13 @@ +# tf + +Simple image containing [Terraform][terraform], [OpenTofu][opentofu] and [Terragrunt][terragrunt]. + +## Usage + +```bash +docker pull ghcr.io/hpedrorodrigues/tf +``` + +[terraform]: https://www.terraform.io +[opentofu]: https://opentofu.org +[terragrunt]: https://terragrunt.gruntwork.io diff --git a/tf/Taskfile.yml b/tf/Taskfile.yml new file mode 100644 index 0000000..5db7e67 --- /dev/null +++ b/tf/Taskfile.yml @@ -0,0 +1,7 @@ +version: '3' + +includes: + common: + taskfile: ../.tasks.yml + vars: + IMAGE: tf diff --git a/tf/tf.apko.yaml b/tf/tf.apko.yaml new file mode 100644 index 0000000..9ab6294 --- /dev/null +++ b/tf/tf.apko.yaml @@ -0,0 +1,24 @@ +contents: + repositories: + - https://packages.wolfi.dev/os + keyring: + - https://packages.wolfi.dev/os/wolfi-signing.rsa.pub + packages: + - terraform + - opentofu + - terragrunt + +archs: + - x86_64 + - aarch64 + +environment: + PATH: /usr/sbin:/sbin:/usr/bin:/bin + +work-dir: /mnt + +annotations: + org.opencontainers.image.title: tf + org.opencontainers.image.description: Simple image containing Terraform, OpenTofu and Terragrunt. + org.opencontainers.image.authors: Pedro Rodrigues + org.opencontainers.image.source: https://github.com/hpedrorodrigues/images/tree/main/tf