From de8bb0a5f8e1f9369fe25cf5a72fc51bbc275b08 Mon Sep 17 00:00:00 2001 From: John Kallies <3021949+JohnKallies@users.noreply.github.com> Date: Thu, 9 Mar 2023 13:27:38 -0500 Subject: [PATCH 1/2] Small fix to reindex command and osmt_cli.sh --- .../kotlin/edu/wgu/osmt/elasticsearch/ReindexCommand.kt | 1 - osmt_cli.sh | 6 +++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/api/src/main/kotlin/edu/wgu/osmt/elasticsearch/ReindexCommand.kt b/api/src/main/kotlin/edu/wgu/osmt/elasticsearch/ReindexCommand.kt index b883696ab..2c52657fb 100644 --- a/api/src/main/kotlin/edu/wgu/osmt/elasticsearch/ReindexCommand.kt +++ b/api/src/main/kotlin/edu/wgu/osmt/elasticsearch/ReindexCommand.kt @@ -22,7 +22,6 @@ class ReindexCommand: CommandLineRunner { private lateinit var applicationContext: ApplicationContext override fun run(vararg args: String?) { - elasticSearchReindexer.deleteAllIndices() elasticSearchReindexer.reindexAll() (applicationContext as ConfigurableApplicationContext).close() } diff --git a/osmt_cli.sh b/osmt_cli.sh index 501e9bed4..85844210f 100755 --- a/osmt_cli.sh +++ b/osmt_cli.sh @@ -390,7 +390,11 @@ load_static_ci_dataset(){ echo _validate_mysql_client || return 1 - local -i db_container_count; db_container_count="$(docker ps -q --filter name=${OSMT_STACK_NAME}_db_1 | wc -l)" + local -i db_container_count=0; + # some installations of Docker delimit container names with hyphens. Others use underscores. + db_container_count+="$(docker ps -q --filter name=${OSMT_STACK_NAME}_db_1 | wc -l)" + db_container_count+="$(docker ps -q --filter name=${OSMT_STACK_NAME}-db-1 | wc -l)" + echo_debug $db_container_count if [[ "${db_container_count}" -ne 1 ]]; then echo_err "Development Docker stack MySQL container is not running. Exiting..." return 1 From 4e94ea36de5ca71ec35dbc83a889103577b8e9bb Mon Sep 17 00:00:00 2001 From: John Kallies <3021949+JohnKallies@users.noreply.github.com> Date: Fri, 10 Mar 2023 15:53:43 -0500 Subject: [PATCH 2/2] Address PR feedback --- osmt_cli.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osmt_cli.sh b/osmt_cli.sh index 85844210f..9915c1551 100755 --- a/osmt_cli.sh +++ b/osmt_cli.sh @@ -396,7 +396,8 @@ load_static_ci_dataset(){ db_container_count+="$(docker ps -q --filter name=${OSMT_STACK_NAME}-db-1 | wc -l)" echo_debug $db_container_count if [[ "${db_container_count}" -ne 1 ]]; then - echo_err "Development Docker stack MySQL container is not running. Exiting..." + echo_err "Development Docker stack MySQL container is not running as expected." + echo_err "(${db_container_count} ${OSMT_STACK_NAME} DB containers running. Should be 1). Exiting..." return 1 fi