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 11
11
import subprocess
12
12
from auto_version import auto_version_tool
13
13
from continuous_delivery_scripts .utils .definitions import CommitType
14
+ from continuous_delivery_scripts .utils .git_helpers import LocalProjectRepository
14
15
from continuous_delivery_scripts .utils .configuration import configuration , ConfigurationVariable
15
16
from continuous_delivery_scripts .utils .logging import log_exception , set_log_level
16
17
from continuous_delivery_scripts .utils .filesystem_helpers import cd
@@ -85,13 +86,17 @@ def _update_version_string(
85
86
version_elements: version elements
86
87
"""
87
88
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 ()
88
93
return "%s-%s.%s+%s" % (
89
94
new_version ,
90
95
auto_version_tool .config .BUILD_TOKEN ,
91
- version_elements . get ( auto_version_tool . Constants . COMMIT_COUNT_FIELD ) ,
96
+ commit_count ,
92
97
version_elements .get (auto_version_tool .Constants .COMMIT_FIELD ),
93
98
)
94
- return new_version
99
+ return new_version
95
100
96
101
97
102
def _get_version_elements (native_version_elements : Dict [str , str ]) -> Dict [str , str ]:
You can’t perform that action at this time.
0 commit comments