mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-22 22:27:17 +00:00
fix: [update v1.5]
This commit is contained in:
parent
198ee97d90
commit
ca47764836
3 changed files with 16 additions and 12 deletions
|
@ -25,7 +25,6 @@ def auto_update_enabled(cfg):
|
||||||
# check if files are modify locally
|
# check if files are modify locally
|
||||||
def check_if_files_modified():
|
def check_if_files_modified():
|
||||||
process = subprocess.run(['git', 'ls-files' ,'-m'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
process = subprocess.run(['git', 'ls-files' ,'-m'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
|
|
||||||
if process.returncode == 0:
|
if process.returncode == 0:
|
||||||
modified_files = process.stdout
|
modified_files = process.stdout
|
||||||
if modified_files:
|
if modified_files:
|
||||||
|
@ -197,7 +196,7 @@ def get_git_upper_tags_remote(current_tag, is_fork):
|
||||||
def update_ail(current_tag, list_upper_tags_remote, current_version_path, is_fork):
|
def update_ail(current_tag, list_upper_tags_remote, current_version_path, is_fork):
|
||||||
print('{}git checkout master:{}'.format(TERMINAL_YELLOW, TERMINAL_DEFAULT))
|
print('{}git checkout master:{}'.format(TERMINAL_YELLOW, TERMINAL_DEFAULT))
|
||||||
process = subprocess.run(['git', 'checkout', 'master'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
process = subprocess.run(['git', 'checkout', 'master'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
|
#process = subprocess.run(['ls'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
if process.returncode == 0:
|
if process.returncode == 0:
|
||||||
print(process.stdout.decode())
|
print(process.stdout.decode())
|
||||||
print()
|
print()
|
||||||
|
@ -260,10 +259,16 @@ def launch_update_version(version, roll_back_commit, current_version_path, is_fo
|
||||||
print('{}------------------------------------------------------------------'.format(TERMINAL_YELLOW))
|
print('{}------------------------------------------------------------------'.format(TERMINAL_YELLOW))
|
||||||
print('- Launching Update: {}{}{} -'.format(TERMINAL_BLUE, version, TERMINAL_YELLOW))
|
print('- Launching Update: {}{}{} -'.format(TERMINAL_BLUE, version, TERMINAL_YELLOW))
|
||||||
print('-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --{}'.format(TERMINAL_DEFAULT))
|
print('-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --{}'.format(TERMINAL_DEFAULT))
|
||||||
process = subprocess.run(['bash', update_path], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
process = subprocess.Popen(['bash', update_path], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
|
while True:
|
||||||
|
output = process.stdout.readline().decode()
|
||||||
|
if output == '' and process.poll() is not None:
|
||||||
|
break
|
||||||
|
if output:
|
||||||
|
print(output.strip())
|
||||||
if process.returncode == 0:
|
if process.returncode == 0:
|
||||||
output = process.stdout.decode()
|
#output = process.stdout.decode()
|
||||||
print(output)
|
#print(output)
|
||||||
|
|
||||||
with open(current_version_path, 'w') as version_content:
|
with open(current_version_path, 'w') as version_content:
|
||||||
version_content.write(version)
|
version_content.write(version)
|
||||||
|
@ -273,8 +278,8 @@ def launch_update_version(version, roll_back_commit, current_version_path, is_fo
|
||||||
print('------------------------------------------------------------------{}'.format(TERMINAL_DEFAULT))
|
print('------------------------------------------------------------------{}'.format(TERMINAL_DEFAULT))
|
||||||
print()
|
print()
|
||||||
else:
|
else:
|
||||||
print(process.stdout.decode())
|
#print(process.stdout.read().decode())
|
||||||
print('{}{}{}'.format(TERMINAL_RED, process.stderr.decode(), TERMINAL_DEFAULT))
|
print('{}{}{}'.format(TERMINAL_RED, process.stderr.read().decode(), TERMINAL_DEFAULT))
|
||||||
print('------------------------------------------------------------------')
|
print('------------------------------------------------------------------')
|
||||||
print(' {}Update Error: {}{}{}'.format(TERMINAL_RED, TERMINAL_BLUE, version, TERMINAL_DEFAULT))
|
print(' {}Update Error: {}{}{}'.format(TERMINAL_RED, TERMINAL_BLUE, version, TERMINAL_DEFAULT))
|
||||||
print('------------------------------------------------------------------')
|
print('------------------------------------------------------------------')
|
||||||
|
|
|
@ -142,11 +142,8 @@ if __name__ == '__main__':
|
||||||
for key in r_serv_metadata.scan_iter(key_to_rename):
|
for key in r_serv_metadata.scan_iter(key_to_rename):
|
||||||
new_key = key.replace(PASTES_FOLDER, '', 1)
|
new_key = key.replace(PASTES_FOLDER, '', 1)
|
||||||
# a hset with this key already exist
|
# a hset with this key already exist
|
||||||
if r_serv_metadata.exists(new_key):
|
keys_to_rename.append((key, new_key))
|
||||||
print(key)
|
index = index + 1
|
||||||
else:
|
|
||||||
keys_to_rename.append((key, new_key))
|
|
||||||
index = index + 1
|
|
||||||
for key, new_key in keys_to_rename:
|
for key, new_key in keys_to_rename:
|
||||||
r_serv_metadata.rename(key, new_key)
|
r_serv_metadata.rename(key, new_key)
|
||||||
keys_to_rename = None
|
keys_to_rename = None
|
||||||
|
|
|
@ -30,6 +30,8 @@ while $flag_ardb; do
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "Fixing ARDB ..."
|
||||||
echo ""
|
echo ""
|
||||||
bash -c "python ${AIL_HOME}/update/v1.5/Update.py"
|
bash -c "python ${AIL_HOME}/update/v1.5/Update.py"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue