made changes to update feature
This commit is contained in:
parent
b8137d2cb8
commit
841345f15b
@ -26,15 +26,21 @@ def update_rangolio(rangolio_location):
|
||||
# Update server
|
||||
shutil.move(settings.DEPLOY_CONFIG["DEPLOY_LOCATION"]+'/server',
|
||||
f'{settings.DEPLOY_CONFIG["DEPLOY_LOCATION"]}/server.old')
|
||||
|
||||
run_npm_command('npm_run', f'{rangolio_location}/frontend/viewable-ui', ['build:server'])
|
||||
git_update_viewable_ui(f'{settings.DEPLOY_CONFIG["DEPLOY_LOCATION"]}/server', 'server.old')
|
||||
git_update_viewable_ui(f'{settings.DEPLOY_CONFIG["DEPLOY_LOCATION"]}/server.old', 'server', False)
|
||||
shutil.move(settings.DEPLOY_CONFIG["DEPLOY_LOCATION"]+'/server.old',
|
||||
f'{settings.DEPLOY_CONFIG["DEPLOY_LOCATION"]}/server')
|
||||
|
||||
|
||||
# Update ghpages
|
||||
shutil.move(settings.DEPLOY_CONFIG["DEPLOY_LOCATION"]+'/ghpages',
|
||||
f'{settings.DEPLOY_CONFIG["DEPLOY_LOCATION"]}/ghpages.old')
|
||||
|
||||
run_npm_command('npm_run', f'{rangolio_location}/frontend/viewable-ui', ['build:ghpages'])
|
||||
git_update_viewable_ui(f'{settings.DEPLOY_CONFIG["DEPLOY_LOCATION"]}/ghpages', 'ghpages.old')
|
||||
git_update_viewable_ui(f'{settings.DEPLOY_CONFIG["DEPLOY_LOCATION"]}/ghpages.old', 'ghpages', False)
|
||||
shutil.move(settings.DEPLOY_CONFIG["DEPLOY_LOCATION"]+'/ghpages.old',
|
||||
f'{settings.DEPLOY_CONFIG["DEPLOY_LOCATION"]}/ghpages')
|
||||
|
||||
# Update editor-ui
|
||||
run_npm_command('npm_run', f'{rangolio_location}/frontend/editable-ui', ['build'])
|
||||
|
||||
@ -72,11 +72,16 @@ def git_check_user_details(deploy_location):
|
||||
return True
|
||||
|
||||
|
||||
def git_update_viewable_ui(deploy_location, dist_folder_name):
|
||||
def git_update_viewable_ui(deploy_location, dist_folder_name, copy_index_and_asset=True):
|
||||
# deploy_location = server.old ; dist_folder_name = server
|
||||
|
||||
# server.old -> server.old.temp
|
||||
shutil.move(deploy_location, f'{deploy_location}.temp')
|
||||
|
||||
# server -> server.old
|
||||
shutil.move(f'{settings.DEPLOY_CONFIG["DEPLOY_LOCATION"]}/{dist_folder_name}', f'{deploy_location}')
|
||||
|
||||
if copy_index_and_asset:
|
||||
copy_content(
|
||||
f'{deploy_location}.temp/index.html',
|
||||
deploy_location,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user