Compare commits

...

1 Commits

Author SHA1 Message Date
Your Name f75c5e1d8e fix: ci 1 year ago
  1. 9
      iot_upload.py

9
iot_upload.py

@ -183,6 +183,7 @@ def calculate_md5(file_path):
if not data:
break
md5.update(data)
print( file_path + 'MD5值为' + md5.hexdigest())
return md5.hexdigest()
def build_the_current_windowsApp(name):
@ -195,10 +196,10 @@ def build_the_current_windowsApp(name):
platformAppAdd('/drone/src/Sources/Setup.exe', '.exe')
else:
print ("比对新老版本zip文件")
content1 = calculate_md5(the_last_windowsAppZIP)
content2 = calculate_md5(the_current_windowsAppZIP)
if content1 != content2:
if calculate_md5(the_last_windowsAppZIP) == calculate_md5(the_current_windowsAppZIP):
print ("\033[34m比对结果: 程序版本无更新,流程终止\033[0m")
else:
print ("比对结果:程序版本已更新")
os.system('mkdir -p /tmp/a/ /tmp/b/ /tmp/IOTContainer/')
os.system('unzip ' + the_last_windowsAppZIP + ' -d /tmp/a/')
@ -208,8 +209,6 @@ def build_the_current_windowsApp(name):
platformAppAdd(diff_zip, '.zip')
build_for_windowsApp()
platformAppAdd('/drone/src/Sources/Setup.exe', '.exe')
else:
print ("\033[34m比对结果: 程序版本无更新,流程终止\033[0m")

Loading…
Cancel
Save