Skip to content

Commit

Permalink
Deprecate RHEL7 from dist-gen sources as well
Browse files Browse the repository at this point in the history
Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
  • Loading branch information
phracek committed Jul 2, 2024
1 parent dfb39b7 commit 0578ceb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 72 deletions.
29 changes: 0 additions & 29 deletions specs/multispec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,6 @@ specs:
img_name: "fedora/varnish-7"
full_img_name: "quay.io/{{ spec.img_name }}"
etc_path: /etc
centos:
distros:
- centos-7-x86_64
s2i_base: quay.io/centos7/s2i-core-centos7
install_pkgs: "gettext hostname nss_wrapper bind-utils rh-varnish{{ spec.version }}-varnish gcc"
org: "centos7"
prod: "centos7"
img_name: "{{ spec.org }}/varnish-{{ spec.version }}-{{ spec.prod }}"
full_img_name: "quay.io/{{ spec.img_name }}"
repo_setup: yum install -y centos-release-scl-rh && \
staging_repo_setup: >-4
yum-config-manager --add-repo https://cbs.centos.org/repos/sclo7-rh-varnish{{ spec.version }}-rh-candidate/x86_64/os/ && \
echo gpgcheck=0 >> /etc/yum.repos.d/cbs.centos.org_repos_sclo7-rh-varnish{{ spec.version }}-rh-candidate_x86_64_os_.repo && \
etc_path: /etc/opt/rh/rh-varnish{{ spec.version }}
var_path: /var/opt/rh/rh-varnish{{ spec.version }}
rhel7:
distros:
- rhel-7-x86_64
s2i_base: rhscl/s2i-core-rhel7
from_tag: "1"
install_pkgs: "gettext hostname nss_wrapper bind-utils rh-varnish{{ spec.version }}-varnish gcc"
org: "rhscl"
prod: "rhel7"
img_name: "{{ spec.org }}/varnish-{{ spec.version }}-{{ spec.prod }}"
full_img_name: "{{ spec.img_name }}"
repo_setup: prepare-yum-repositories rhel-server-rhscl-7-rpms && \
etc_path: /etc/opt/rh/rh-varnish{{ spec.version }}
var_path: /var/opt/rh/rh-varnish{{ spec.version }}
rhel8:
distros:
- rhel-8-x86_64
Expand Down Expand Up @@ -81,7 +53,6 @@ specs:
matrix:
include:
- distros:
- rhel-7-x86_64
- rhel-8-x86_64
- rhel-9-x86_64
- centos-stream-9-x86_64
Expand Down
27 changes: 1 addition & 26 deletions src/Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,17 @@ LABEL summary="$SUMMARY" \
name="{{ spec.img_name }}" \
maintainer="Uhliarik Lubos <luhliari@redhat.com>"

RUN {{ macros.populate_install_pkgs(spec) }}
RUN INSTALL_PKGS="{{ spec.install_pkgs }}" && \
{% if spec.repo_setup %}
{{ spec.repo_setup }}
{% endif %}
{% if spec.staging and spec.staging_repo_setup %}
{{ spec.staging_repo_setup }}
{% endif %}
{{ commands.pkginstaller.install([], {'docs': False}) }} $INSTALL_PKGS && \
rpm -V $INSTALL_PKGS && \
{% if config.os.id == "fedora" or spec.prod == "rhel8" or spec.prod == "rhel9" or spec.prod == "c9s" %}
fix-permissions $VARNISH_CONFIGURATION_PATH && \
fix-permissions /var/lib/varnish && \
varnishd -V 2>&1 | grep -qe "varnish-$VARNISH_VERSION\." && echo "Found VERSION $VARNISH_VERSION" && \
{% endif %}
{% if spec.prod == "rhel7" %}
scl enable rh-varnish$VARNISH_VERSION -- varnishd -V 2>&1 | grep -qe "varnish-$VARNISH_VERSION\." && echo "Found VERSION $VARNISH_VERSION" && \
{% endif %}
rm -f /etc/profile.d/lang.sh && \
rm -f /etc/profile.d/lang.csh && \
{{ commands.pkginstaller.cleancache() }}
Expand All @@ -50,30 +44,11 @@ COPY {{ spec.version }}/s2i/bin/ $STI_SCRIPTS_PATH
# Copy extra files to the image.
COPY {{ spec.version }}/root/ /

{% if config.os.id != "fedora" and spec.prod != "rhel8" and spec.prod != "rhel9" and spec.prod != "c9s" %}
# In order to drop the root user, we have to make some directories world
# writeable as OpenShift default security model is to run the container under
# random UID.
RUN chmod -R a+rwx ${APP_ROOT}/etc && \
chmod -R a+rwx {{ spec.var_path }} && \
chmod -R a+rwx {{ spec.etc_path }} && \
chown -R 1001:0 ${APP_ROOT} && \
chown -R 1001:0 {{ spec.var_path }} && \
chown -R 1001:0 {{ spec.etc_path }}
{% else %}
RUN chmod -R a+rwx ${APP_ROOT}/etc && \
chown -R 1001:0 ${APP_ROOT}
{% endif %}
# Reset permissions of filesystem to default values
RUN rpm-file-permissions

USER 1001

{% if config.os.id != "fedora" and spec.prod != "rhel8" and spec.prod != "rhel9" and spec.prod != "c9s" %}
# VOLUME ["{{ spec.etc_path }}/varnish"]

ENV BASH_ENV=${APP_ROOT}/etc/scl_enable \
ENV=${APP_ROOT}/etc/scl_enable \
PROMPT_COMMAND=". ${APP_ROOT}/etc/scl_enable"
{% endif %}
CMD $STI_SCRIPTS_PATH/usage
19 changes: 2 additions & 17 deletions src/macros.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
{% if config.os.id == "fedora" %}
VERSION=0 \
{% endif %}
{% if (spec.prod == "rhel7" or spec.prod == "centos7") and spec.version|int > 5 %}
VARNISH_VCL=/etc/opt/rh/rh-varnish{{ spec.version }}/varnish/default.vcl \
{% elif spec.version|int > 5 %}
{% if spec.version|int > 5 %}
VARNISH_VCL=/etc/varnish/default.vcl \
{% endif %}
VARNISH_CONFIGURATION_PATH={{ spec.etc_path }}/varnish
Expand All @@ -15,23 +13,10 @@
io.openshift.tags="builder,varnish" \
version="$VERSION" \
com.redhat.component="varnish" \
{%- elif spec.prod in ["rhel8", "rhel9", "c9s" ] %}
{%- else %}
io.openshift.tags="builder,varnish{{ spec.version }},varnish-{{ spec.version }}" \
com.redhat.component="varnish-{{ spec.version }}-container" \
com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#rhel" \
version="1" \
{%- else %}
io.openshift.tags="builder,varnish,rh-varnish{{ spec.version }}" \
com.redhat.component="rh-varnish{{ spec.version }}-container" \
com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#rhel" \
version="{{ spec.version }}" \
{%- endif %}
{% endmacro %}

{% macro populate_install_pkgs(spec) %}
{% if (spec.prod == "rhel7" or spec.prod == "centos7") and spec.version == "6" %}
INSTALL_PKGS="{{ spec.install_pkgs }} rh-varnish6-varnish-modules" && \
{%- else %}
INSTALL_PKGS="{{ spec.install_pkgs }}" && \
{%- endif %}
{% endmacro %}

0 comments on commit 0578ceb

Please sign in to comment.