1
0

First version of BCI based on Tumbleweed

OBS-URL: https://build.opensuse.org/package/show/devel:BCI:Tumbleweed/rmt-server-image?expand=0&rev=1
This commit is contained in:
Dan Čermák 2022-04-28 12:35:52 +00:00 committed by Git OBS Bridge
commit 84ef167fd4
6 changed files with 117 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

33
Dockerfile Normal file
View File

@ -0,0 +1,33 @@
# SPDX-License-Identifier: MIT
#!BuildTag: suse/rmt-server:2.7
#!BuildTag: suse/rmt-server:2.7-%RELEASE%
FROM opensuse/tumbleweed:latest
MAINTAINER SUSE LLC (https://www.suse.com/)
# Define labels according to https://en.opensuse.org/Building_derived_containers
# labelprefix=com.suse.application.rmt-server
LABEL org.opencontainers.image.title="SLE RMT Server Container Image"
LABEL org.opencontainers.image.description="SUSE RMT Server based on the SLE Base Container Image."
LABEL org.opencontainers.image.version="2.7"
LABEL org.opencontainers.image.url="https://www.suse.com/products/server/"
LABEL org.opencontainers.image.created="%BUILDTIME%"
LABEL org.opencontainers.image.vendor="SUSE LLC"
LABEL org.opensuse.reference="registry.suse.com/suse/rmt-server:2.7-%RELEASE%"
LABEL org.openbuildservice.disturl="%DISTURL%"
LABEL com.suse.supportlevel="techpreview"
LABEL com.suse.eula="sle-bci"
LABEL com.suse.lifecycle-url="https://www.suse.com/lifecycle"
LABEL com.suse.image-type="application"
LABEL com.suse.release-stage="beta"
# endlabelprefix
RUN set -euo pipefail && zypper -n in --no-recommends rmt-server catatonit && zypper -n clean && rm -rf /var/log/*
ENV RAILS_ENV="production"
ENV LANG="en"
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD ["/usr/share/rmt/bin/rails", "server", "-e", "production"]
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh

5
_service Normal file
View File

@ -0,0 +1,5 @@
<services>
<service mode="buildtime" name="kiwi_metainfo_helper"/>
<service mode="buildtime" name="docker_label_helper"/>
</services>

55
entrypoint.sh Normal file
View File

@ -0,0 +1,55 @@
#!/bin/sh
set -e
# PV could be empty, make sure the directories exist
mkdir -p /var/lib/rmt/public/repo
mkdir -p /var/lib/rmt/public/suma
mkdir -p /var/lib/rmt/regsharing
mkdir -p /var/lib/rmt/tmp
# Set permissions
chown -R _rmt:nginx /var/lib/rmt
if [ -z "${MYSQL_HOST}" ]; then
echo "MYSQL_HOST not set!"
exit 1
fi
if [ -z "${MYSQL_PASSWORD}" ]; then
echo "MYSQL_PASSWORD not set!"
exit 1
fi
MYSQL_DATABASE="${MYSQL_DATABASE:-rmt}"
MYSQL_USER="${MYSQL_USER:-rmt}"
# 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" >> /etc/rmt.conf
echo -e "log_level:\n rails: debug" >> /etc/rmt.conf
if [ $# -eq 0 ]; then
set -- /usr/share/rmt/bin/rails server -e production
fi
if [ "$1" == "/usr/share/rmt/bin/rails" -a "$2" == "server" ]; then
echo "Create/migrate RMT database"
pushd /usr/share/rmt > /dev/null
/usr/share/rmt/bin/rails db:create db:migrate RAILS_ENV=production
popd > /dev/null
echo "Syncing product list"
rmt-cli sync
for PRODUCT in $SCC_PRODUCT_ENABLE
do
rmt-cli products enable $PRODUCT
done
for PRODUCT in $SCC_PRODUCT_DISABLE
do
rmt-cli products disable $PRODUCT
done
rmt-cli repos clean
echo "Executing: catatonit -- $@"
exec catatonit -- "$@"
else
echo "Executing: $@"
exec "$@"
fi

0
rmt-server-image.changes Normal file
View File