diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..68f269e --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,43 @@ + + + + + +### List of changes + + + +### Motivation and context + + + +### Type of changes + +- [ ] Add new resources +- [ ] Update configuration to existing resources +- [ ] Remove existing resources +- [ ] Other + +### Env to apply + +- [x] DEV + +### Does this introduce a change to production resources with possible user impact? + +- [ ] Yes, users may be impacted applying this change +- [ ] No + +### Does this introduce an unwanted change on infrastructure? Check terraform plan execution result + +- [ ] Yes +- [ ] No + +### Other information + + + +--- + +### If PR is partially applied, why? (reserved to mantainers) + + diff --git a/.github/workflows/check_helm.yml b/.github/workflows/check_helm.yml new file mode 100644 index 0000000..6f06ba3 --- /dev/null +++ b/.github/workflows/check_helm.yml @@ -0,0 +1,38 @@ +name: check_helm + +on: + push: + +jobs: + check_helm: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: setup_python + uses: actions/setup-python@v2 + + - name: setup_pip + run: | + python -m ensurepip --upgrade + + - name: setup_checkcov + run: | + python -m pip install -U checkov + + - name: setup_helm + run: | + curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 + chmod 700 get_helm.sh + ./get_helm.sh + + - name: run_checkov + run: | + FILE=./util/values.checkov.yaml + if [ -f "${FILE}" ]; then + checkov -d src --var-file "${FILE}" --framework helm + else + echo "${FILE} does not exist." + exit 0 + fi diff --git a/.github/workflows/pr-title.yml b/.github/workflows/pr-title.yml new file mode 100644 index 0000000..b33aff1 --- /dev/null +++ b/.github/workflows/pr-title.yml @@ -0,0 +1,55 @@ +name: "Validate PR title" + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + +jobs: + main: + name: Validate PR title + runs-on: ubuntu-latest + steps: + # Please look up the latest version from + # https://github.com/amannn/action-semantic-pull-request/releases + - uses: amannn/action-semantic-pull-request@v3.4.6 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + # Configure which types are allowed. + # Default: https://github.com/commitizen/conventional-commit-types + types: | + fix + feat + docs + chore + breaking + # Configure that a scope must always be provided. + requireScope: false + # Configure additional validation for the subject based on a regex. + # This example ensures the subject starts with an uppercase character. + subjectPattern: ^.+$ + # If `subjectPattern` is configured, you can use this property to override + # the default error message that is shown when the pattern doesn't match. + # The variables `subject` and `title` can be used within the message. + subjectPatternError: | + The subject "{subject}" found in the pull request title "{title}" + didn't match the configured pattern `^.+$/`. Please ensure that the subject + starts with an uppercase character. + # For work-in-progress PRs you can typically use draft pull requests + # from Github. However, private repositories on the free plan don't have + # this option and therefore this action allows you to opt-in to using the + # special "[WIP]" prefix to indicate this state. This will avoid the + # validation of the PR title and the pull request checks remain pending. + # Note that a second check will be reported if this is enabled. + wip: true + # When using "Squash and merge" on a PR with only one commit, GitHub + # will suggest using that commit message instead of the PR title for the + # merge commit, and it's easy to commit this by mistake. Enable this option + # to also validate the commit message for one commit PRs. + validateSingleCommit: false + # Related to `validateSingleCommit` you can opt-in to validate that the PR + # title matches a single commit to avoid confusion. + validateSingleCommitMatchesPrTitle: false diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..2dddfaa --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,33 @@ +name: Release + +on: + # Trigger the workflow on push or pull request, + # but only for the main branch + push: + branches: + - main + paths-ignore: + - "CODEOWNERS" + - "**.md" + - ".**" + +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + persist-credentials: false + fetch-depth: 0 + + - name: Release + uses: cycjimmy/semantic-release-action@v2 + with: + semantic_version: 18.0.0 + extra_plugins: | + @semantic-release/release-notes-generator@10.0.3 + @semantic-release/git@10.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e43b0f9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..6651b1a --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,12 @@ +repos: + - repo: https://github.com/norwoodj/helm-docs + rev: v1.11.3 + hooks: + - id: helm-docs + args: + # Make the tool search for charts only under the `example-charts` directory + - --chart-search-root=charts/microservice-chart + - repo: https://github.com/gruntwork-io/pre-commit + rev: v0.1.23 # Get the latest from: https://github.com/gruntwork-io/pre-commit/releases + hooks: + - id: helmlint diff --git a/.releaserc.js b/.releaserc.js new file mode 100644 index 0000000..2044d14 --- /dev/null +++ b/.releaserc.js @@ -0,0 +1,19 @@ +module.exports = { + branches: ["main", "master"], + ci: false, + tagFormat: "microservice-chart-${version}", + plugins: [ + [ + "@semantic-release/commit-analyzer", + { + preset: "angular", + releaseRules: [ + { type: "breaking", release: "major" }, + { type: "major", release: "major" }, + ], + }, + ], + "@semantic-release/release-notes-generator", + "@semantic-release/github", + ], +};