Change file name

This commit is contained in:
minchulahn
2023-06-22 15:48:56 +09:00
parent d2874aa81d
commit fc9b6d8e48
4 changed files with 27 additions and 30 deletions

27
main.py
View File

@@ -1,27 +0,0 @@
import json, sys, traceback
def get_service_index():
for index, value in enumerate(json_data['service']):
if(value['name'] == serviceName):
return index
exit(traceback.print_exc())
def set_latest_version():
service_index = get_service_index()
json_data["service"][service_index]["latest_candidate_version"] = releaseTag
if __name__ == '__main__':
if len(sys.argv) != 3:
exit(traceback.print_exc())
releaseTag = sys.argv[1]
serviceName = sys.argv[2]
file_path = "./version.json"
with open(file_path, 'r') as json_file:
json_data = json.load(json_file)
set_latest_version()
with open(file_path, 'w') as file:
json.dump(json_data, file, indent=4)

View File

@@ -1,4 +1,2 @@
jsontemplates==0.1.0
PyYAML==6.0
pandas==2.0.2
tabulate==0.9.0
PyYAML==6.0

26
update_version.py Normal file
View File

@@ -0,0 +1,26 @@
import json, sys, traceback
if len(sys.argv) != 3:
exit(traceback.print_exc())
def get_service_index():
for index, value in enumerate(json_data['service']):
if(value['name'] == serviceName):
return index
exit(traceback.print_exc())
def set_latest_version():
service_index = get_service_index()
json_data["service"][service_index]["latest_candidate_version"] = releaseTag
releaseTag = sys.argv[1]
serviceName = sys.argv[2]
file_path = "./version.json"
with open(file_path, 'r') as json_file:
json_data = json.load(json_file)
set_latest_version()
with open(file_path, 'w') as file:
json.dump(json_data, file, indent=4)