Skip to content

Commit

Permalink
style(action): try to create nicer log output from prepare and servic…
Browse files Browse the repository at this point in the history
…e scripts
  • Loading branch information
poikilotherm committed Apr 8, 2024
1 parent 5076ff0 commit 0c6a28a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 1 addition & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 5 additions & 1 deletion scripts/service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down

0 comments on commit 0c6a28a

Please sign in to comment.