Compare commits
5 Commits
1.1.0.post
...
1.1.0.post
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a5f39d6cb2 | ||
|
|
c6ed7ef0a1 | ||
|
|
0ef5a8f463 | ||
|
|
e06a3b00ae | ||
|
|
d3bf6ddaa6 |
22
Jenkinsfile
vendored
22
Jenkinsfile
vendored
@@ -184,16 +184,14 @@ pipeline {
|
||||
|
||||
sh(". ~/BUILD_ENV/bin/activate && pip install --upgrade setuptools build pip copier jinja2-slug toml")
|
||||
|
||||
sh(". ~/TOOLS_ENV/bin/activate && pip install simple_rest_client requests twine")
|
||||
sh(". ~/TOOLS_ENV/bin/activate && pip install simple_rest_client requests twine packaging")
|
||||
|
||||
script {
|
||||
if(_PROJECT_NAME!="pygitversionhelper") {
|
||||
sh(". ~/TOOLS_ENV/bin/activate && pip install pygitversionhelper")
|
||||
}
|
||||
else
|
||||
{
|
||||
//TODO: need to install pygitversionhelper deps from a better way...
|
||||
sh(". ~/TOOLS_ENV/bin/activate && pip install packaging")
|
||||
if(_PROJECT_NAME!="pychangelogfactory") {
|
||||
sh(". ~/TOOLS_ENV/bin/activate && pip install pychangelogfactory")
|
||||
}
|
||||
}
|
||||
sh("git config --global user.email $_MaintainerEmail")
|
||||
@@ -574,6 +572,11 @@ pipeline {
|
||||
|from simple_rest_client.resource import Resource
|
||||
|
|
||||
|try:
|
||||
| from pychangelogfactory import ChangelogFactory
|
||||
|except ImportError:
|
||||
| from src.pychangelogfactory import ChangelogFactory
|
||||
|
|
||||
|try:
|
||||
| from pygitversionhelper import gitversionhelper
|
||||
|except ImportError:
|
||||
| from src.pygitversionhelper import gitversionhelper
|
||||
@@ -619,6 +622,15 @@ pipeline {
|
||||
|ReleaseContent = "${_ReleaseContent_Title}" + "\\n" \\
|
||||
| + "\\n" \\
|
||||
| + "Reference documentation: [mkdocs page](https://chacha.ddns.net/mkdocs-web/${_PROJECT_USER_NAME}/${PY_PROJECT_NAME}/${_GIT_BRANCH}/${PY_PROJECT_VERSION_STRIPPED}/) "
|
||||
|
|
||||
|LastTag=gitversionhelper.tag.getLastTag(same_branch=True)
|
||||
|CommitHistory=gitversionhelper.commit.getMessagesSinceTag(LastTag, merged_output=True, ignore_merged=True)
|
||||
|Changelog = ChangelogFactory(CommitHistory).RenderFullChangelog()
|
||||
|
|
||||
|ReleaseContent = ReleaseContent + "\\n"+ "\\n"+ "## Changelog:\\n" + Changelog
|
||||
|
|
||||
|if not Changelog:
|
||||
| ReleaseContent = ReleaseContent + "code/project maintainance"
|
||||
|
|
||||
|data={
|
||||
| "body": ReleaseContent,
|
||||
|
||||
@@ -19,7 +19,6 @@ from radon.cli import Config
|
||||
from radon.cli.harvest import CCHarvester, HCHarvester, MIHarvester
|
||||
|
||||
from .helper_base import helper_withresults_base
|
||||
from pprint import pprint
|
||||
|
||||
|
||||
class complexity_check(helper_withresults_base):
|
||||
|
||||
@@ -158,6 +158,7 @@ class gitversionhelper: # pylint: disable=too-few-public-methods
|
||||
Keyword Arguments:
|
||||
kwargs/merged_output (bool): Output one single merged string
|
||||
kwargs/same_branch (bool): Force searching only in the same branch
|
||||
kwargs/ignore_merged (bool): ignore merged commits
|
||||
Returns:
|
||||
the commit message
|
||||
"""
|
||||
@@ -166,10 +167,20 @@ class gitversionhelper: # pylint: disable=too-few-public-methods
|
||||
tag_commit_id = cls.getFromTag(tag)
|
||||
print(f"tag_commit_id = {tag_commit_id}")
|
||||
|
||||
str_cmd: str
|
||||
if ("same_branch" in kwargs) and (kwargs["same_branch"] is True):
|
||||
commits = _exec(f"git rev-list --first-parent --ancestry-path {tag_commit_id}..{current_commit_id}")
|
||||
str_cmd = f"git rev-list --first-parent {tag_commit_id}..{current_commit_id}" # ok
|
||||
else:
|
||||
commits = _exec(f"git rev-list --ancestry-path {tag_commit_id}..{current_commit_id}")
|
||||
str_cmd = f"git rev-list {tag_commit_id}..{current_commit_id}" # ok
|
||||
|
||||
if ("ignore_merged" in kwargs) and (kwargs["ignore_merged"] is True):
|
||||
str_cmd = str_cmd + " --no-merges" # ok
|
||||
|
||||
try:
|
||||
commits = _exec(str_cmd)
|
||||
except gitversionhelper.unknownGITFatalError as _e:
|
||||
raise cls.commitNotFound("no commit found in commit history") from _e
|
||||
|
||||
result = []
|
||||
for commit in commits:
|
||||
result.append(cls.getMessage(commit))
|
||||
@@ -188,7 +199,7 @@ class gitversionhelper: # pylint: disable=too-few-public-methods
|
||||
"""
|
||||
try:
|
||||
res = _exec(
|
||||
f'git log -z --pretty="tformat:%B%-C()" -n 1 {commit_hash}',
|
||||
f'git log -z --pretty="tformat:%B%-C()" -n 1 {commit_hash}', # ok
|
||||
None,
|
||||
True,
|
||||
)
|
||||
@@ -207,9 +218,10 @@ class gitversionhelper: # pylint: disable=too-few-public-methods
|
||||
the commit Id
|
||||
"""
|
||||
try:
|
||||
res = _exec(f"git rev-list -n 1 {tag}")
|
||||
res = _exec(f"git rev-list -n 1 {tag}") # ok
|
||||
except gitversionhelper.unknownGITFatalError as _e:
|
||||
raise cls.commitNotFound("no commit found in commit history") from _e
|
||||
|
||||
if len(res) == 0:
|
||||
raise cls.commitNotFound("no commit found in commit history")
|
||||
return res[0]
|
||||
@@ -227,7 +239,7 @@ class gitversionhelper: # pylint: disable=too-few-public-methods
|
||||
if ("same_branch" in kwargs) and (kwargs["same_branch"] is True):
|
||||
str_cmd = "git rev-list --max-count=1 --date-order HEAD --first-parent" # ok
|
||||
else:
|
||||
str_cmd = "git log --format=%H --all -n1"
|
||||
str_cmd = "git log --format=%H --all -n1" # ok
|
||||
|
||||
if ("ignore_merged" in kwargs) and (kwargs["ignore_merged"] is True):
|
||||
str_cmd = str_cmd + " --no-merges" # ok
|
||||
|
||||
Reference in New Issue
Block a user