feat(git_release): Migrated from ansible-roles

Mibrated from
    commit: 295fe5b1db

After migration, updated for gitlab-ci.

Changes to be committed:
	new file:   gitlab_release/.gitlab-ci.yml
	new file:   gitlab_release/README.md
	new file:   gitlab_release/python-module/cz_nfc/cz_nfc.py
	new file:   gitlab_release/python-module/cz_nfc/setup.py
	new file:   gitlab_release/requirements.txt

issue #1
This commit is contained in:
2021-08-03 15:44:31 +09:30
parent 2a3266fb53
commit 6678a3dbab
5 changed files with 165 additions and 0 deletions

View File

@ -0,0 +1,40 @@
#!/usr/bin/env python3
#-*- coding: utf-8 -*-
from commitizen import git
from commitizen.cz.base import BaseCommitizen
class nfc_cz(BaseCommitizen):
bump_pattern = r"^(break|new|fix|hotfix|ci|docs)"
bump_map = {"break": "MAJOR", "new": "MINOR", "fix": "PATCH", "hotfix": "PATCH", "ci": "PATCH", "docs": "PATCH"}
changelog_pattern = "^(break|new|fix|hotfix|ci|docs)"
change_type_order = ["BREAKING CHANGE", "feat", "fix", "refactor", "perf", "docs", "ci"]
change_type_map = {
"feat": "Features",
"fix": "Bug Fixes",
"refactor": "Code Refactor",
"perf": "Performance improvements",
"docs": "Documentaton / Guides",
"ci": "Continious Integration"
}
commit_parser = r"^(?P<change_type>feat|fix|refactor|perf|BREAKING CHANGE|ci|docs)(?:\((?P<scope>[^()\r\n]*)\)|\()?(?P<breaking>!)?:\s(?P<message>.*)?"
def changelog_message_builder_hook(self, parsed_message: dict, commit: git.GitCommit) -> dict:
rev = commit.rev
m = parsed_message["message"]
parsed_message["message"] = f"{rev} - {m}"
return parsed_message
def questions(self) -> list:
raise NotImplementedError("Not Implemented yet")
def message(self, answers: dict) -> str:
raise NotImplementedError("Not Implemented yet")
discover_this = nfc_cz

View File

@ -0,0 +1,10 @@
from setuptools import setup
setup(
name='NFC commitizen Custom Bump Map and changelog',
version='0.1.0',
py_modules=['cz_nfc'],
license='MIT',
long_description='this is a long description',
install_requires=['commitizen']
)