diff --git a/Jenkinsfile b/Jenkinsfile index f5c912c..8683d0f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,6 +6,8 @@ // You should have received a copy of the license along with this // work. If not, see . + + // configurable settings: // use to send email if workflow problem def _MaintainerName = "CHACHA" @@ -17,7 +19,7 @@ def _bPreRelease = false // toogle Draft flag on Gitea release system => If False, TAG is not created def _bDraft = false // release content / changelog management -def _bAutoChangelog = false //Not supported yet +def _bAutoChangelog = true //Not supported yet def _ReleaseContent_Title = "_CI/CD Automatic Release_" // full rebuild toogle def _bFullRebuilt = true @@ -152,26 +154,6 @@ pipeline { withCredentials([usernamePassword(credentialsId: _SCMCredentials, passwordVariable: 'GIT_PASSWORD', usernameVariable: 'GIT_USERNAME')]) { sh("git remote set-url origin https://${GIT_USERNAME}:${GIT_PASSWORD}@chacha.ddns.net/gitea/${_PROJECT_USER_NAME}/${_PROJECT_NAME}.git") } - - // using git to get the latest tag on this branch (before processing) - def latestTag_beforeProcessing = sh(returnStdout: true, script: "git tag --sort=-creatordate | head -n 1").trim() - echo("latestTag_beforeProcessing:. . . . . . . . . . . . $latestTag_beforeProcessing") - - sh(script: """#!/bin/sh - - |. ~/TOOLS_ENV/bin/activate - |exec python - << '__EOWRAPPER__' - | - |from pygitversionhelper import gitversionhelper - | - |print(f"most recent repository tag: {gitversionhelper.tag.getLastTag()}") - |print(f"most recent repository tag: {gitversionhelper.tag.getLastTag(same_branch=True)}") - |print(f"number of commit since last tag: {gitversionhelper.tag.getDistanceFromTag()}") - |print(f"number of commit since last tag: {gitversionhelper.tag.getDistanceFromTag(same_branch=True)}") - |print(f"most recent repository version: {gitversionhelper.version.getLastVersion(formated_output=True)}") - |print(f'current repository version: {gitversionhelper.version.getCurrentVersion(formated_output=True,version_std="PEP440",bump_type="dev",bump_dev_strategy="post")}') - | - |__EOWRAPPER__ - """.stripMargin()) if(_GIT_BRANCH=="master") { if(sh(returnStdout: true, script: "git tag --points-at HEAD").trim().isEmpty()) { @@ -203,23 +185,7 @@ pipeline { } } } - - sh(script: """#!/bin/sh - - |. ~/TOOLS_ENV/bin/activate - |exec python - << '__EOWRAPPER__' - | - |from pygitversionhelper import gitversionhelper - | - |print(f"most recent repository tag: {gitversionhelper.tag.getLastTag()}") - |print(f"most recent repository tag: {gitversionhelper.tag.getLastTag(same_branch=True)}") - |print(f"number of commit since last tag: {gitversionhelper.tag.getDistanceFromTag()}") - |print(f"number of commit since last tag: {gitversionhelper.tag.getDistanceFromTag(same_branch=True)}") - |print(f"most recent repository version: {gitversionhelper.version.getLastVersion(formated_output=True)}") - |print(f'current repository version: {gitversionhelper.version.getCurrentVersion(formated_output=True,version_std="PEP440",bump_type="dev",bump_dev_strategy="post")}') - | - |__EOWRAPPER__ - """.stripMargin()) - + latestTag = sh(script: """#!/bin/sh - |. ~/TOOLS_ENV/bin/activate |exec python - << '__EOWRAPPER__' @@ -474,13 +440,15 @@ pipeline { |. ~/TOOLS_ENV/bin/activate |exec python - << '__EOWRAPPER__' | - |from simple_rest_client.api import API - |from simple_rest_client.resource import Resource |import json |import glob |import requests |import shutil | + |from simple_rest_client.api import API + |from simple_rest_client.resource import Resource + |from pygitversionhelper import gitversionhelper + | |from urllib.parse import urljoin | |class GiteaRepoCommits(Resource): diff --git a/pyproject.toml b/pyproject.toml index ccbcdfe..a88db09 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,15 +7,9 @@ # work. If not, see . [build-system] -#requires = ["setuptools>=63", "wheel", "setuptools-git-versioning<2"] requires = ["setuptools>=63", "wheel", "setuptools_scm"] build-backend = "setuptools.build_meta" -#[tool.setuptools-git-versioning] -#enabled = true -#dev_template = "{tag}.post{ccount}" -#tag_filter = "^\\d+\\.\\d+\\.\\d+$" - [tool.setuptools_scm] version_scheme= "post-release" @@ -55,8 +49,8 @@ where = ["src"] "pygitversionhelper.data" = ["*.*"] [project.urls] -Homepage = "https://chacha.ddns.net/gitea/chacha/pygitversionhelper" -Documentation = "https://chacha.ddns.net/gitea/chacha/pygitversionhelper/wiki" +Homepage = "https://chacha.ddns.net/gitea/chacha/pygitversionhelper/" +Documentation = "https://chacha.ddns.net/mkdocs-web/chacha/pygitversionhelper/master/latest/" Tracker = "https://chacha.ddns.net/gitea/chacha/pygitversionhelper/issues" [project.optional-dependencies]