Skip to content

Commit

Permalink
Make image names and version actually overrideable from inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
poikilotherm committed Sep 20, 2023
1 parent f1f5502 commit 419e6d2
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 7 deletions.
32 changes: 27 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ inputs:
description: "Name of Configbaker image (can include registry)"
required: true
default: "docker.io/gdcc/configbaker"
postgresql_version:
description: "Override the PostgreSQL version to use"
required: false
solr_version:
description: "Override the Solr version to use"
required: false
create-dv:
description: "Whether or not to create an example Dataverse"
required: true
Expand All @@ -29,10 +35,26 @@ runs:
- name: "Prepare environment variables"
shell: bash
run: |
echo "POSTGRES_VERSION=$(docker inspect -f '{{ index .Config.Labels "org.dataverse.deps.postgresql.version"}}' '${{ inputs.image_dataverse }}:${{ inputs.image_tag }}')" >> ${GITHUB_ENV}
echo "SOLR_VERSION=$(docker inspect -f '{{ index .Config.Labels "org.dataverse.deps.solr.version"}}' '${{ inputs.image_dataverse }}:${{ inputs.image_tag }}')" >> ${GITHUB_ENV}
echo "DATAVERSE_DB_USER=dataverse" >> "${GITHUB_ENV}"
echo "DATAVERSE_DB_PASSWORD=secret" >> "${GITHUB_ENV}"
PG_VERSION=$(docker inspect -f '{{ index .Config.Labels "org.dataverse.deps.postgresql.version"}}' '${{ inputs.image_dataverse }}:${{ inputs.image_tag }}')
if [ -z "${PG_VERSION}" ]; then; PG_VERSION=${{ inputs.postgresql_version }}; fi
if [ -z "${PG_VERSION}" ]; then
echo "Cannot find PostgreSQL version"; exit 1
else
echo "POSTGRES_VERSION=$PG_VERSION" | tee -a "${GITHUB_ENV}"
fi
SOLR_VERSION=$(docker inspect -f '{{ index .Config.Labels "org.dataverse.deps.solr.version"}}' '${{ inputs.image_dataverse }}:${{ inputs.image_tag }}')
if [ -z "${SOLR_VERSION}" ]; then; SOLR_VERSION=${{ inputs.solr_version }}; fi
if [ -z "${SOLR_VERSION}" ]; then
echo "Cannot find Solr version"; exit 1
else
echo "SOLR_VERSION=$SOLR_VERSION" | tee -a "${GITHUB_ENV}"
fi
echo "CONFIGBAKER_IMAGE=${{ inputs.image_configbaker }}:${{ inputs.image_tag }}" | tee -a "${GITHUB_ENV}"
echo "DATAVERSE_IMAGE=${{ inputs.image_dataverse }}:${{ inputs.image_tag }}" | tee -a "${GITHUB_ENV}"
echo "DATAVERSE_DB_USER=dataverse" | tee -a "${GITHUB_ENV}"
echo "DATAVERSE_DB_PASSWORD=secret" | tee -a "${GITHUB_ENV}"
- name: "Start Dataverse service in background"
shell: bash
run: |
Expand All @@ -45,7 +67,7 @@ runs:
shell: bash
run: |
echo "::group::🤖 Bootstrap Dataverse service"
docker run -i --network apitest_dataverse gdcc/configbaker:alpha bootstrap.sh dev
docker run -i --network apitest_dataverse "${CONFIGBAKER_IMAGE}" bootstrap.sh dev
echo "::endgroup::"
- name: Retrieve API Token
run: ${{ github.action_path }}/scripts/get_api_token.sh
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
dataverse:
container_name: 'dataverse'
hostname: dataverse
image: gdcc/dataverse:alpha
image: ${DATAVERSE_IMAGE}
restart: on-failure
user: payara
environment:
Expand Down Expand Up @@ -40,7 +40,7 @@ services:

solr_initializer:
container_name: 'solr_initializer'
image: gdcc/configbaker:alpha
image: ${CONFIGBAKER_IMAGE}
restart: 'no'
command:
- sh
Expand Down

0 comments on commit 419e6d2

Please sign in to comment.