Skip to content

Commit

Permalink
Refactor folder structure references from 'terraform-module' to 'terr…
Browse files Browse the repository at this point in the history
…aform/module' and update related documentation
  • Loading branch information
httpdss committed Dec 16, 2024
1 parent 057672f commit 33c145a
Show file tree
Hide file tree
Showing 17 changed files with 113 additions and 67 deletions.
8 changes: 4 additions & 4 deletions README.es.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,9 @@ structure:
print("Hello, World!")
folders:
- .devops/modules/mod1:
struct: terraform-module
struct: terraform/module
- .devops/modules/mod2:
struct: terraform-module
struct: terraform/module
with:
module_name: mymod2
- ./:
Expand Down Expand Up @@ -269,9 +269,9 @@ Ejemplo:
```yaml
folders:
- .devops/modules/mod1:
struct: terraform-module
struct: terraform/module
- .devops/modules/mod2:
struct: terraform-module
struct: terraform/module
with:
module_name: mymod2
```
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ structure:
print("Hello, World!")
folders:
- .devops/modules/mod1:
struct: terraform-module
struct: terraform/module
- .devops/modules/mod2:
struct: terraform-module
struct: terraform/module
with:
module_name: mymod2
- ./:
Expand Down Expand Up @@ -267,9 +267,9 @@ Example:
```yaml
folders:
- .devops/modules/mod1:
struct: terraform-module
struct: terraform/module
- .devops/modules/mod2:
struct: terraform-module
struct: terraform/module
with:
module_name: mymod2
```
Expand Down
4 changes: 2 additions & 2 deletions example/structure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ structure:
run: echo Hello, world!
folders:
- .devops/modules/mod1:
struct: terraform-module
struct: terraform/module
- .devops/modules/mod2:
struct: terraform-module
struct: terraform/module
with:
module_name: mymod2
- ./:
Expand Down
4 changes: 2 additions & 2 deletions struct_module/commands/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ def execute(self, args):
# Example:
# folders:
# - .devops/modules/my_module_one:
# struct: terraform-module
# struct: terraform/module
# - .devops/modules/my_module_two:
# struct: terraform-module
# struct: terraform/module
# with:
# module_name: my_module_two
def _validate_folders_config(self, folders):
Expand Down
60 changes: 16 additions & 44 deletions struct_module/contribs/generic-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -172,50 +172,6 @@ structure:
# Canonical name and email address for the app owner
# app-owner <
- .pre-commit-config.yaml:
content: |
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- .tf/states/environments/dev/main.tf:
content: "# Terraform configuration for the dev environment"
- .tf/states/environments/dev/providers.tf:
content: |
provider "aws" {
region = "${ aws_region }"
}
- .tf/states/environments/prod/main.tf:
content: "# Terraform configuration for the prod environment"
- .tf/states/environments/prod/providers.tf:
content: |
provider "aws" {
region = "${ aws_region }"
}
- .tf/states/environments/qa/main.tf:
content: "# Terraform configuration for the qa environment"
- .tf/states/environments/qa/providers.tf:
content: |
provider "aws" {
region = "${ aws_region }"
}
- .tf/states/environments/stage/main.tf:
content: "# Terraform configuration for the stage environment"
- .tf/states/environments/stage/providers.tf:
content: |
provider "aws" {
region = "${ aws_region }"
}
- .tf/states/init/main.tf:
content: "# Terraform configuration for the init environment"
- .tf/states/init/providers.tf:
content: |
provider "aws" {
region = "${ aws_region }"
}
- ACKNOWLEDGEMENTS.md:
content: |
# Acknowledgements
Expand Down Expand Up @@ -335,3 +291,19 @@ structure:
# tools Folder
Convenience directory for your use. Should contain scripts to automate tasks in the project, for example, build scripts, rename scripts. Usually contains .sh, .cmd files for example.
folders:
- .devops/apps/environments/prod:
struct: terraform/module
- .devops/apps/environments/stage:
struct: terraform/module
- .devops/apps/environments/qa:
struct: terraform/module
- .devops/apps/environments/dev:
struct: terraform/module
- .devops/apps/init:
struct: terraform/module
- ./:
struct:
- github/workflows/pre-commit
- github/workflows/release-drafter
11 changes: 0 additions & 11 deletions struct_module/contribs/github-workflows.yaml

This file was deleted.

6 changes: 6 additions & 0 deletions struct_module/contribs/github/workflows/all-workflows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
folders:
- ./:
struct:
- github/workflows/pre-commit
- github/workflows/release-drafter
- github/workflows/terraform-workflow
76 changes: 76 additions & 0 deletions struct_module/contribs/github/workflows/release-drafter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
structure:
- .github/workflows/release-drafter.yaml:
content: |
name: Release Drafter
on:
push:
branches:
- {{@ current_repo() | default_branch @}}
jobs:
update_release_draft:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@{{@ "actions/checkout" | latest_release @}}
with:
fetch-depth: 0
- uses: release-drafter/release-drafter@{{@ "release-drafter/release-drafter" | latest_release @}}
id: release-drafter
with:
config-name: release-drafter.yml
publish: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: version
id: version
run: |
git pull --tags
echo ${{ steps.release-drafter.outputs.tag_name }}
tag=${{ steps.release-drafter.outputs.tag_name }}
version=${tag#v}
major=${version%%.*}
echo "tag=${tag}" >> $GITHUB_OUTPUT
echo "version=${version}" >> $GITHUB_OUTPUT
echo "major=${major}" >> $GITHUB_OUTPUT
- name: force update major tag
run: |
git tag v${{ steps.version.outputs.major }} ${{ steps.version.outputs.tag }} -f
git push origin refs/tags/v${{ steps.version.outputs.major }} -f
- .github/release-drafter.yml:
content: |
name-template: "v$RESOLVED_VERSION 🌈"
tag-template: "v$RESOLVED_VERSION"
categories:
- title: "🚀 Features"
labels:
- "feature"
- "enhancement"
- title: "🐛 Bug Fixes"
labels:
- "fix"
- "bugfix"
- "bug"
change-template: "- $TITLE @$AUTHOR (#$NUMBER)"
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
version-template: "$MAJOR.$MINOR.$PATCH"
version-resolver:
major:
labels:
- "major"
minor:
labels:
- "minor"
patch:
labels:
- "patch"
default: patch
template: |
## Changes
$CHANGES
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
structure:
- .github/workflows/terrform-workflow.yaml:
file: https://raw.githubusercontent.com/httpdss/github-workflows/main/.github/workflows/terraform-workflow.yaml
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 33c145a

Please sign in to comment.