|
|
|
@ -149,6 +149,7 @@ class GitDbUtil: |
|
|
|
|
# 从git中获取版本列表后和数据库对比,添加新的版本到数据库 |
|
|
|
|
def set_release_to_db(self): |
|
|
|
|
local_repo = Repo(self.local_code_path) |
|
|
|
|
local_repo.git.execute('git fetch --all') |
|
|
|
|
release = [] |
|
|
|
|
for remote in local_repo.remotes: |
|
|
|
|
for ref in remote.refs: |
|
|
|
@ -156,9 +157,12 @@ class GitDbUtil: |
|
|
|
|
saved_release = Release.objects.all() |
|
|
|
|
saved_release_version_list = [rel.release for rel in saved_release] |
|
|
|
|
for rel in release: |
|
|
|
|
# print(rel) |
|
|
|
|
if rel in saved_release_version_list: |
|
|
|
|
print('pass') |
|
|
|
|
pass |
|
|
|
|
# print('pass') |
|
|
|
|
else: |
|
|
|
|
print(rel) |
|
|
|
|
data = { |
|
|
|
|
'release': rel, |
|
|
|
|
'short_release': rel.replace('origin/', ''), |
|
|
|
|