Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
vijay-stephen authored Dec 6, 2024
0 parents commit 1c2c397
Show file tree
Hide file tree
Showing 28 changed files with 1,060 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# EditorConfig is awesome: http://EditorConfig.org
# Uses editorconfig to maintain consistent coding styles

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
max_line_length = 80
trim_trailing_whitespace = true

[*.{tf,tfvars}]
indent_size = 2
indent_style = space

[*.md]
max_line_length = 0
trim_trailing_whitespace = false

[Makefile]
tab_width = 2
indent_style = tab

[COMMIT_EDITMSG]
max_line_length = 0

[*.{yaml,yml}]
max_line_length = 120
14 changes: 14 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# terraform
*.tf text=auto eol=lf

# dot files
*.gitattributes text=auto eol=lf
*.yaml text=auto eol=lf
*.yml text=auto eol=lf
*.md text=auto eol=lf
.gitignore text=auto eol=lf
.editorconfig text=auto eol=lf
.terraform-version text=auto eol=lf

# golang
*.go text=auto eol=lf
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: 'bug'
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: 'enhancement'
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
39 changes: 39 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
## Description

Please provide a brief description of the changes introduced by this pull request.

## Related Issue

- [Issue Number](link-to-issue): Brief description

## Checklist

Please ensure that the following steps are completed before submitting the pull request:

- [ ] Code follows the Terraform best practices and style guidelines.
- [ ] Changes are appropriately documented, including any necessary updates to README or other documentation files.
- [ ] Unit tests have been added or updated to cover the changes introduced by this pull request.
- [ ] Changes have been tested locally and verified to work as expected.
- [ ] The code has been reviewed to ensure it aligns with the project's goals and standards.
- [ ] Dependencies and backward compatibility have been considered and addressed if applicable.

## Type of change

Please delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Intermediate change (work in progress)

## Testing Instructions

Provide detailed steps or instructions for testing the changes introduced by this pull request.

## Screenshots

Include any relevant screenshots or visual aids to help reviewers understand the changes visually, if applicable.

## Additional Notes

Add any additional notes or context that might be helpful for reviewers or users testing the changes.
54 changes: 54 additions & 0 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
name: "Run Pre Commit Checks"

on: # yamllint disable-line rule:truthy
push:
branches:
- "**"
- "!main"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
## run pre-commit
pre-commit:
name: Run pre-commit checks
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
actions: write
pages: write
id-token: write

steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.ARC_JOB_TOKEN }}

- uses: actions/setup-python@v3

- name: Install terraform-docs
run: |
cd /tmp
curl -sSLo ./terraform-docs.tar.gz \
https://terraform-docs.io/dl/v0.16.0/terraform-docs-v0.16.0-$(uname)-amd64.tar.gz
tar -xzf terraform-docs.tar.gz
rm terraform-docs.tar.gz
chmod +x terraform-docs
mv terraform-docs /usr/local/bin/terraform-docs
- name: Install tflint
run: |
cd /tmp
curl -s https://raw.githubusercontent.com/terraform-linters/tflint/master/install_linux.sh | bash
- name: Run pre-commit
uses: pre-commit/[email protected]
continue-on-error: true # we want to push the changes pre-commit makes

- name: Push pre-commit changes to branch
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Push pre-commit changes
35 changes: 35 additions & 0 deletions .github/workflows/snyk.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: snyk

on: # yamllint disable-line rule:truthy
push:
branches:
- "**" # matches every branch
- "!main" # excludes main
pull_request:
branches:
- main

jobs:
security:
runs-on:
- arc
name: snyk
steps:
- name: checkout
uses: actions/checkout@v3
- name: Vulnerability scan
uses: snyk/actions/iac@master
with:
command: monitor
args: --severity-threshold=low
- name: Set up Node 18
uses: actions/setup-node@v3
with:
node-version: 18
- name: install Snyk CLI
run: npm install -g snyk
- name: snyk monitor
run: snyk iac test --report --severity-threshold=medium
env:
SNYK_TOKEN: ${{ secrets.ARC_SNYK_TOKEN }}
29 changes: 29 additions & 0 deletions .github/workflows/tag-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: Bump version
on: # yamllint disable-line rule:truthy
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Bump version and push tag
id: tag
uses: anothrNick/github-tag-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEFAULT_BUMP: patch
REPO_OWNER: sourcefuse
- name: Create Release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.tag.outputs.tag }}
release_name: v${{ steps.tag.outputs.tag }}
body: ${{ github.release_notes }}
draft: false
prerelease: false
32 changes: 32 additions & 0 deletions .github/workflows/tflint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Test

on: # yamllint disable-line rule:truthy
push:
branches:
- "**" # matches every branch
- "!main" # excludes main
pull_request:
branches:
- main

jobs:
tflint:
runs-on:
- arc
name: tflint
steps:
- uses: actions/checkout@master

- uses: terraform-linters/setup-tflint@v1
with:
tflint_version: latest

- name: Show version
run: tflint --version

- name: Init tflint
run: tflint --init

- name: Run tflint
run: tflint -f compact
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.terraform
terraform.tfstate
*.tfstate*
terraform.tfvars
*.backup
.idea
.external_momdules
33 changes: 33 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
repos:
- repo: https://github.com/adrienverge/yamllint
rev: v1.35.1
hooks:
- id: yamllint
args:
- '-d {extends: default, rules: {line-length: {max: 120}}}' # override to match .editorconfig
- -s
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-yaml
args:
- --allow-multiple-documents
- id: check-merge-conflict
- id: trailing-whitespace
args:
- --markdown-linebreak-ext=md
- id: end-of-file-fixer
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.88.2
hooks:
- id: terraform_validate
- id: terraform_tflint
- id: terraform_fmt
args:
- --args=-recursive
- id: terraform_docs
- repo: https://github.com/dnephin/pre-commit-golang
rev: v0.5.1
hooks:
- id: go-fmt
2 changes: 2 additions & 0 deletions .snyk
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
# ignores vulnerabilities until expiry date; change duration by modifying expiry date
1 change: 1 addition & 0 deletions .terraform-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
latest:^1.5
25 changes: 25 additions & 0 deletions .terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1c2c397

Please sign in to comment.