From 0c6a28a66e88560cbd7f76e3b0592fe4a07c2fd0 Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Mon, 8 Apr 2024 08:19:15 +0200 Subject: [PATCH] style(action): try to create nicer log output from prepare and service scripts --- action.yml | 5 +---- scripts/service.sh | 6 +++++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/action.yml b/action.yml index 8d2c5c8..0ac6cc2 100644 --- a/action.yml +++ b/action.yml @@ -49,10 +49,9 @@ runs: run: | docker pull -q ${{ inputs.image_dataverse }}:${{ inputs.image_tag }} docker pull -q ${{ inputs.image_configbaker }}:${{ inputs.image_tag }} - - name: "Prepare environment" + - name: "Prepare environment variables, push them to GITHUB_ENV file" shell: bash run: | - # Prepare environment variables. Will push them into file GITHUB_ENV and log ${{ github.action_path }}/scripts/prepare.sh -p "${{ inputs.postgresql_version }}" -s "${{ inputs.solr_version }}" \ -d "${{ inputs.image_dataverse }}" -c "${{ inputs.image_configbaker }}" -t "${{ inputs.image_tag }}" \ -o dv/conf @@ -67,9 +66,7 @@ runs: - name: "Start Dataverse service in background" shell: bash run: | - echo "::group::🥎 Start Dataverse service in background" ${{ github.action_path }}/scripts/service.sh up -d -p apitest -f "${{ inputs.flavor }}" - echo "::endgroup::" # Bootstrap will wait up until accessible, so blocking here. - name: "Bootstrap Dataverse service" id: bootstrap diff --git a/scripts/service.sh b/scripts/service.sh index aa1b87c..a66eb4f 100755 --- a/scripts/service.sh +++ b/scripts/service.sh @@ -59,13 +59,17 @@ elif [[ -f "$(pwd)/${FLAVOR_DIRECTORY}/compose.yml" ]]; then fi FLAVOR_FILE_OPTION="" -if [[ ! -z "${FLAVOR_COMPOSE_FILE}" ]]; then +if [[ -n "${FLAVOR_COMPOSE_FILE}" ]]; then echo "🌶️ Using flavor compose file at ${FLAVOR_COMPOSE_FILE}" FLAVOR_FILE_OPTION="-f ${FLAVOR_COMPOSE_FILE}" +elif [[ -n "${FLAVOR_DIRECTORY}" ]]; then + echo "😱 Could not find a ${FLAVOR_DIRECTORY}/compose.yml anywhere." fi +echo "::group::🥎 Start Dataverse services" # shellcheck disable=SC2086 docker compose -f "${GITHUB_ACTION_PATH}/docker-compose.yml" ${FLAVOR_FILE_OPTION} -p "${PROJECT_OPTION}" ${ACTION_OPTION} +echo "::endgroup::" if [[ "$ACTION" == "up" ]]; then echo -e "✅️ Dataverse containers have been started."