Skip to content

Commit

Permalink
ci(AZ-1391): enable semantic-release [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
Shr3ps committed Apr 18, 2024
1 parent af8e83a commit 45cfb94
Show file tree
Hide file tree
Showing 6 changed files with 214 additions and 19 deletions.
4 changes: 4 additions & 0 deletions .commitlintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
extends:
- '@commitlint/config-conventional'
rules:
header-max-length: [0, "always", 120]
1 change: 0 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ variables:
AZURERM_PROVIDER_MIN_VERSION: "3.18"

include:
- template: 'Workflows/Branch-Pipelines.gitlab-ci.yml'
- project: 'claranet/projects/cloud/azure/terraform/ci'
ref: master
file: '/pipeline.yml'
Expand Down
1 change: 1 addition & 0 deletions .gitlab/merge_request_templates/default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@ldap-sync/FR-Git-Cellule-Cloud-Azure
58 changes: 40 additions & 18 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,30 +1,52 @@
default_install_hook_types: [commit-msg, pre-commit]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
stages: [pre-commit]
- id: end-of-file-fixer
stages: [pre-commit]
- id: check-json
stages: [pre-commit]
- id: check-yaml
stages: [pre-commit]
args:
- --unsafe
- id: check-symlinks
stages: [pre-commit]
- id: check-added-large-files
stages: [pre-commit]
args:
- --maxkb=15000
- id: detect-private-key
stages: [pre-commit]

- repo: https://github.com/antonbabenko/pre-commit-terraform.git
rev: v1.88.4
hooks:
- id: terraform_fmt
stages: [pre-commit]
- id: terraform_docs
stages: [pre-commit]
args:
- --args=--config=.config/terraform-docs.yml
exclude: "^modules|^example|^tools"
- id: terraform_validate
stages: [pre-commit]
exclude: ^examples
- id: terraform_tflint
stages: [pre-commit]
exclude: ^examples
args:
- --args=--config=__GIT_WORKING_DIR__/.config/tflint.hcl
- --env-vars=TFLINT_LOG="info"
- id: terraform_tfsec
stages: [pre-commit]

- repo: https://github.com/antonbabenko/pre-commit-terraform.git
rev: v1.77.1
hooks:
- id: terraform_fmt
- id: terraform_docs
args:
- --args=--config=.config/terraform-docs.yml
exclude: '^modules|^example|^tools'
- id: terraform_validate
exclude: ^examples
- id: terraform_tflint
exclude: ^examples
args:
- --args=--config=__GIT_WORKING_DIR__/.config/tflint.hcl
- --env-vars=TFLINT_LOG="info"
- id: terraform_tfsec
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v3.2.0
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
args: [] # optional: list of Conventional Commits types to allow e.g. [feat, fix, ci, chore, test]
164 changes: 164 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
{
"branches": [
"master",
"main"
],
"tagFormat": "v${version}",
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "conventionalcommits",
"releaseRules": [
{
"type": "docs",
"release": "patch"
},
{
"type": "refactor",
"release": "patch"
},
{
"type": "test",
"release": "patch"
},
{
"type": "style",
"release": "patch"
},
{
"type": "revert",
"release": "patch"
}
],
"parserOpts": {
"noteKeywords": [
"BREAKING CHANGE",
"BREAKING CHANGES",
"BREAKING"
]
}
}
],
[
"@semantic-release/release-notes-generator",
{
"linkReferences": false,
"linkCompare": false,
"preset": "conventionalcommits",
"parserOpts": {
"noteKeywords": [
"BREAKING CHANGE",
"BREAKING CHANGES",
"BREAKING"
]
},
"presetConfig": {
"types": [
{
"type": "feat",
"section": "Features",
"hidden": false
},
{
"type": "fix",
"section": "Bug Fixes",
"hidden": false
},
{
"type": "docs",
"section": "Documentation",
"hidden": false
},
{
"type": "style",
"section": "Styles",
"hidden": false
},
{
"type": "refactor",
"section": "Code Refactoring",
"hidden": false
},
{
"type": "perf",
"section": "Performance Improvements",
"hidden": false
},
{
"type": "test",
"section": "Tests",
"hidden": false
},
{
"type": "ci",
"section": "Continuous Integration",
"hidden": false
},
{
"type": "chore",
"section": "Miscellaneous Chores",
"hidden": false
},
{
"type": "revert",
"section": "Revert",
"hidden": false
}
]
}
}
],
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md"
}
],
[
"@semantic-release/git",
{
"assets": [
"CHANGELOG.md"
]
}
],
[
"@semantic-release/gitlab",
{
"gitlabUrl": "https://git.fr.clara.net",
"assets": [
"CHANGELOG.md"
]
}
],
[
"semantic-release-slack-bot",
{
"packageName": "Azure TF module",
"notifyOnSuccess": true,
"notifyOnFail": true,
"markdownReleaseNotes": true,
"onSuccessTemplate": {
"text": "New Azure TF module release",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":dancing-tofu: New :azure3: module ($repo_path) version out! *$npm_package_version* :dancing-tofu:"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "$release_notes"
}
}
]
}
}
]
]
}
5 changes: 5 additions & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pre-commit 3.7.0
opentofu 1.6.2
terraform-docs 0.17.0
tflint 0.50.3
trivy 0.50.1

0 comments on commit 45cfb94

Please sign in to comment.