From 1250c7efe64174b8221c2fdc16c19e660eaedea4 Mon Sep 17 00:00:00 2001 From: Simon Li Date: Wed, 22 Nov 2023 10:10:28 +0000 Subject: [PATCH 1/2] Add changelog --- ecs-cluster/CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 ecs-cluster/CHANGELOG.md diff --git a/ecs-cluster/CHANGELOG.md b/ecs-cluster/CHANGELOG.md new file mode 100644 index 0000000..6470c0e --- /dev/null +++ b/ecs-cluster/CHANGELOG.md @@ -0,0 +1,7 @@ +# Changelog + +## 1.0.0 - 2023-11-23 + +First full release + +- Keycloak 22.05 From 88a692b229dfffa3f905de17f8a2e34c7c24ed04 Mon Sep 17 00:00:00 2001 From: Simon Li Date: Wed, 22 Nov 2023 10:26:40 +0000 Subject: [PATCH 2/2] Add pre-commit --- .github/workflows/ci.yml | 18 ++++++++++-------- .github/workflows/container.yml | 1 - .pre-commit-config.yaml | 17 +++++++++++++++++ README.md | 2 ++ ecs-cluster/keycloak.tf | 2 +- ecs-cluster/outputs.tf | 2 +- ecs-cluster/versions.tf | 1 - 7 files changed, 31 insertions(+), 12 deletions(-) create mode 100644 .pre-commit-config.yaml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 831f433..0bfe7d9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,28 +1,30 @@ --- - name: CI on: push: pull_request: jobs: - validate: - name: terraform validate - runs-on: ubuntu-latest + name: terraform lint and validate + runs-on: ubuntu-22.04 + timeout-minutes: 4 steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install terraform uses: hashicorp/setup-terraform@v2 + - uses: actions/setup-python@v4 + with: + python-version: "3.11" + - name: Validate run: | cd ecs-cluster terraform init -backend=false terraform validate - - name: Lint - run: | - terraform fmt -recursive --diff -check + - name: pre-commit + uses: pre-commit/action@v3.0.0 diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml index 320e9f3..61b5ff4 100644 --- a/.github/workflows/container.yml +++ b/.github/workflows/container.yml @@ -17,7 +17,6 @@ env: PLATFORMS: linux/amd64,linux/arm64 jobs: - container-build: runs-on: ubuntu-latest steps: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..73d3e81 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,17 @@ +--- +repos: + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v3.1.0 + hooks: + - id: prettier + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-json + - id: check-yaml + - repo: https://github.com/antonbabenko/pre-commit-terraform + rev: v1.83.6 + hooks: + - id: terraform_fmt diff --git a/README.md b/README.md index ba16077..e597953 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # Keycloak on ECS with RDS + [![CI](https://github.com/hic-infra/ecs-keycloak/actions/workflows/ci.yml/badge.svg)](https://github.com/hic-infra/ecs-keycloak/actions/workflows/ci.yml) [![Container build](https://github.com/manics/ecs-keycloak/actions/workflows/container.yml/badge.svg)](https://github.com/manics/ecs-keycloak/actions/workflows/container.yml) @@ -27,6 +28,7 @@ Create an S3 backend configuration file (see [`ecs-cluster/example.s3.tfbackend` Check the [Terraform variables](ecs-cluster/variables.tf), and define them in a `*.tfvars` file, e.g. `example.tfvars`. Initialise the terraform directory passing (first time only), then run: + ```sh cd ecs-cluster terraform init -backend-config=example.s3.tfbackend diff --git a/ecs-cluster/keycloak.tf b/ecs-cluster/keycloak.tf index 234a5bc..8706233 100644 --- a/ecs-cluster/keycloak.tf +++ b/ecs-cluster/keycloak.tf @@ -366,4 +366,4 @@ resource "aws_ecs_service" "keycloak" { # lifecycle { # ignore_changes = [desired_count] # } -} \ No newline at end of file +} diff --git a/ecs-cluster/outputs.tf b/ecs-cluster/outputs.tf index 0422f2d..e2121ac 100644 --- a/ecs-cluster/outputs.tf +++ b/ecs-cluster/outputs.tf @@ -4,4 +4,4 @@ output "dnsname" { output "keycloak-initial-password" { value = random_string.initial-keycloak-password.result -} \ No newline at end of file +} diff --git a/ecs-cluster/versions.tf b/ecs-cluster/versions.tf index 3cb71f8..c8311d5 100644 --- a/ecs-cluster/versions.tf +++ b/ecs-cluster/versions.tf @@ -25,4 +25,3 @@ terraform { required_version = ">= 1.5.0" } -