File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
continuous_delivery_scripts Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 1111import subprocess
1212from auto_version import auto_version_tool
1313from continuous_delivery_scripts .utils .definitions import CommitType
14+ from continuous_delivery_scripts .utils .git_helpers import LocalProjectRepository
1415from continuous_delivery_scripts .utils .configuration import configuration , ConfigurationVariable
1516from continuous_delivery_scripts .utils .logging import log_exception , set_log_level
1617from continuous_delivery_scripts .utils .filesystem_helpers import cd
@@ -85,13 +86,17 @@ def _update_version_string(
8586 version_elements: version elements
8687 """
8788 if commit_type == CommitType .DEVELOPMENT :
89+ commit_count = version_elements .get (auto_version_tool .Constants .COMMIT_COUNT_FIELD )
90+ if not commit_count :
91+ with LocalProjectRepository () as git :
92+ commit_count = git .get_commit_count ()
8893 return "%s-%s.%s+%s" % (
8994 new_version ,
9095 auto_version_tool .config .BUILD_TOKEN ,
91- version_elements . get ( auto_version_tool . Constants . COMMIT_COUNT_FIELD ) ,
96+ commit_count ,
9297 version_elements .get (auto_version_tool .Constants .COMMIT_FIELD ),
9398 )
94- return new_version
99+ return new_version
95100
96101
97102def _get_version_elements (native_version_elements : Dict [str , str ]) -> Dict [str , str ]:
You can’t perform that action at this time.
0 commit comments