diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 882085de..ac1c6ae2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -49,7 +49,7 @@ jobs: #run restore omero database python manage.py restore_postgresql_database #run indexing indexing - python manage.py get_index_data_from_database + python manage.py get_index_data_from_database -n True # run tests python -m unittest discover -s unit_tests upload: diff --git a/manage.py b/manage.py index b32cb44d..f91c1d80 100644 --- a/manage.py +++ b/manage.py @@ -127,7 +127,12 @@ def restore_postgresql_database(): "--resource", help="resource name, creating all the indexes for all the resources is the default", # noqa ) -def get_index_data_from_database(resource="all"): +@manager.option( + "-n", + "--nobackup", + help="if True, backup will be called ", # noqa +) +def get_index_data_from_database(resource="all", nobackup=None): """ insert data in Elasticsearch index for each resource It gets the data from postgres database server @@ -155,7 +160,8 @@ def get_index_data_from_database(resource="all"): test_indexing_search_query(deep_check=False, check_studies=True) # backup the index data - backup_elasticsearch_data() + if not nobackup: + backup_elasticsearch_data() # set configurations