From 5b9a275756d2ae5891eff2091d3ccb44a90efc91f5a97838461bd9eb9091fd69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= Date: Thu, 31 Oct 2024 16:30:31 +0000 Subject: [PATCH] [info=6a7add0bf9d09dd9bb9f8bec56a65547] OBS-URL: https://build.opensuse.org/package/show/devel:BCI:Tumbleweed/rmt-server-image?expand=0&rev=244 --- Dockerfile | 2 +- entrypoint.sh | 34 +++++++++++++++++++++++++--------- rmt-server-image.changes | 5 +++++ 3 files changed, 31 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 26da3fe..1b37815 100644 --- a/Dockerfile +++ b/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/entrypoint.sh b/entrypoint.sh index 4842cc5..040e858 100644 --- a/entrypoint.sh +++ b/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.changes b/rmt-server-image.changes index fa7fa8c..797530f 100644 --- a/rmt-server-image.changes +++ b/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