Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
TheIronRock95 authored Jul 9, 2023
0 parents commit 0d3b866
Show file tree
Hide file tree
Showing 20 changed files with 657 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/tag-changelog-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
module.exports = {
types: [
{ types: ["feat", "feature"], label: "🎉 New Features" },
{ types: ["fix", "bugfix"], label: "🐛 Bugfixes" },
{ types: ["improvements", "enhancement"], label: "🔨 Improvements" },
{ types: ["perf"], label: "🏎️ Performance Improvements" },
{ types: ["build", "ci"], label: "🏗️ Build System" },
{ types: ["refactor"], label: "🪚 Refactors" },
{ types: ["doc", "docs"], label: "📚 Documentation Changes" },
{ types: ["test", "tests"], label: "🔍 Tests" },
{ types: ["style"], label: "💅 Code Style Changes" },
{ types: ["chore"], label: "🧹 Chores" },
{ types: ["other"], label: "Other Changes" },
{ types: ["terraform-docs"], label: "terraform-docs"},
],

excludeTypes: ["other", "terraform-docs"],

renderTypeSection: function (label, commits) {
let text = `\n## ${label}\n`;

commits.forEach((commit) => {
text += `- ${commit.subject}\n`;
});

return text;
},

renderChangelog: function (release, changes) {
const now = new Date();
return `# ${release} - ${now.toISOString().substr(0, 10)}\n` + changes + "\n\n";
},
};
72 changes: 72 additions & 0 deletions .github/workflows/code-testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: 'Code testing'

on:
push:
branches:
- "main"
pull_request:

permissions:
contents: read

jobs:
terraform:
name: 'Terraform'
runs-on: ubuntu-latest

defaults:
run:
shell: bash

steps:
- name: Checkout
uses: actions/checkout@v3

# Install the latest version of Terraform CLI and configure the Terraform CLI configuration file with a Terraform Cloud user API token
- name: Setup Terraform
uses: hashicorp/setup-terraform@v2
# with:
# cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }}

# Initialize a new or existing Terraform working directory by creating initial files, loading any remote state, downloading modules, etc.
- name: Terraform Init
run: terraform init

# Checks that all Terraform configuration files adhere to a canonical format
- name: Terraform Format
run: terraform fmt -check

# Generates an execution plan for Terraform
# - name: Terraform Plan
# run: terraform plan -input=false

# On push to "main", build or change infrastructure according to Terraform configuration files
# Note: It is recommended to set up a required "strict" status check in your repository for "Terraform Cloud". See the documentation on "strict" required status checks for more information: https://help.github.com/en/github/administering-a-repository/types-of-required-status-checks
# - name: Terraform Apply
# if: github.ref == 'refs/heads/"main"' && github.event_name == 'push'
# run: terraform apply -auto-approve -input=false

checkov:
name: 'Checkov'
runs-on: ubuntu-latest

# Use the Bash shell regardless whether the GitHub Actions runner is ubuntu-latest, macos-latest, or windows-latest
defaults:
run:
shell: bash

steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout
uses: actions/checkout@v3

- name: Run Checkov action
id: checkov
uses: bridgecrewio/checkov-action@master
with:
quiet: true
framework: terraform
output_format: sarif
download_external_modules: true
log_level: WARNING
container_user: 1000
26 changes: 26 additions & 0 deletions .github/workflows/genarate-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: 'Generating documentation'

on:
push:
branches-ignore:
- main

jobs:
build:
name: Documentations
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}

- name: Regenerate README.md
uses: terraform-docs/gh-actions@main
with:
working-dir: .
output-file: README.md
config-file: .terraform-docs.yml
git-push: true
36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: 'Create release'
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Create changelog text
id: changelog
uses: loopwerk/tag-changelog@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
config_file: .github/tag-changelog-config.js


- name: Create release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.tag_version.outputs.new_tag }}
release_name: ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.changelog.outputs.changes }}



34 changes: 34 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Local .terraform directories
**/.terraform/*

# .tfstate files
*.tfstate
*.tfstate.*

# Crash log files
crash.log
crash.*.log

# Exclude all .tfvars files, which are likely to contain sensitive data, such as
# password, private keys, and other secrets. These should not be part of version
# control as they are data points which are potentially sensitive and subject
# to change depending on the environment.
*.tfvars
*.tfvars.json

# Ignore override files as they are usually used to override resources locally and so
# are not checked in
override.tf
override.tf.json
*_override.tf
*_override.tf.json

# Include override files you do wish to add to version control using negated pattern
# !example_override.tf

# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
# example: *tfplan*

# Ignore CLI configuration files
.terraformrc
terraform.rc
43 changes: 43 additions & 0 deletions .terraform-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
formatter: markdown table

header-from: "docs/header-doc.tf"
footer-from: "docs/footer-doc.tf"

content: |-
{{ .Header }}
# Usage - Module
## Network Watcher Flow Log
```hcl
{{ include "examples/network-watcher-flow-log-example/main.tf" }}
```
{{ .Providers }}
{{ .Modules }}
{{ .Resources }}
{{ .Inputs }}
{{ .Outputs }}
{{ .Footer }}
output:
file: README.md
mode: inject

sort:
enabled: true
by: required

settings:
anchor: false
color: true
default: false
description: true
indent: 2
required: true
type: true
Loading

0 comments on commit 0d3b866

Please sign in to comment.