diff --git a/rmt-server-image/Dockerfile b/rmt-server-image/Dockerfile index b7884f6d3..a8fd9c900 100644 --- a/rmt-server-image/Dockerfile +++ b/rmt-server-image/Dockerfile @@ -22,7 +22,7 @@ FROM opensuse/tumbleweed:latest RUN set -euo pipefail; \ - zypper -n install --no-recommends rmt-server catatonit; \ + zypper -n install --no-recommends rmt-server catatonit bash; \ zypper -n clean; \ rm -rf {/target,}/var/log/{alternatives.log,lastlog,tallylog,zypper.log,zypp/history,YaST2} diff --git a/rmt-server-image/entrypoint.sh b/rmt-server-image/entrypoint.sh index 95eede490..d58facbd0 100644 --- a/rmt-server-image/entrypoint.sh +++ b/rmt-server-image/entrypoint.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -e # PV could be empty, make sure the directories exist @@ -23,30 +23,46 @@ MYSQL_USER="${MYSQL_USER:-rmt}" SCC_SYNC="${SCC_SYNC:-true}" # Create adjusted /etc/rmt.conf -echo -e "database:\n host: ${MYSQL_HOST}\n database: ${MYSQL_DATABASE}\n username: ${MYSQL_USER}\n password: ${MYSQL_PASSWORD}" > /etc/rmt.conf -echo -e " adapter: mysql2\n encoding: utf8\n timeout: 5000\n pool: 5\n" >> /etc/rmt.conf -echo -e "scc:\n username: ${SCC_USERNAME}\n password: ${SCC_PASSWORD}\n sync_systems: true\n scc_sync: ${SCC_SYNC}\n" >> /etc/rmt.conf -echo -e "log_level:\n rails: debug" >> /etc/rmt.conf +cat > /etc/rmt.conf < /dev/null /usr/share/rmt/bin/rails db:create db:migrate RAILS_ENV=production popd > /dev/null - if [ ${SCC_SYNC} == "true" ]; then + if [ "${SCC_SYNC}" = "true" ]; then echo "Syncing product list" rmt-cli sync for PRODUCT in $SCC_PRODUCT_ENABLE do - rmt-cli products enable $PRODUCT + rmt-cli products enable "$PRODUCT" done for PRODUCT in $SCC_PRODUCT_DISABLE do - rmt-cli products disable $PRODUCT + rmt-cli products disable "$PRODUCT" done rmt-cli repos clean fi diff --git a/rmt-server-image/rmt-server-image.changes b/rmt-server-image/rmt-server-image.changes index bbb0f4670..36c795bed 100644 --- a/rmt-server-image/rmt-server-image.changes +++ b/rmt-server-image/rmt-server-image.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Oct 31 16:24:36 UTC 2024 - SUSE Update Bot + +- entry point refactoring + ------------------------------------------------------------------- Wed Oct 30 15:34:45 UTC 2024 - SUSE Update Bot