Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a test in Dockerfile directly to check varnish version #132

Merged
merged 2 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion 6/Dockerfile.c8s
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ Varnish Cache stores web pages in memory so web servers don't have to create \
the same web page over and over again. Varnish Cache serves pages much faster \
than any application server; giving the website a significant speed up." \
VARNISH_VCL=/etc/varnish/default.vcl \
VARNISH_CONFIGURATION_PATH=/etc/varnish
VARNISH_CONFIGURATION_PATH=/etc/varnish \
VARNISH_VERSION=6

LABEL summary="$SUMMARY" \
description="$DESCRIPTION" \
Expand All @@ -30,6 +31,7 @@ RUN INSTALL_PKGS="gettext hostname nss_wrapper bind-utils varnish gcc" && \
rpm -V $INSTALL_PKGS && \
fix-permissions $VARNISH_CONFIGURATION_PATH && \
fix-permissions /var/lib/varnish && \
varnishd -V 2>&1 | grep -qe "varnish-$VARNISH_VERSION\." && echo "Found VERSION $VARNISH_VERSION" && \
rm -f /etc/profile.d/lang.sh && \
rm -f /etc/profile.d/lang.csh && \
yum -y clean all --enablerepo='*'
Expand Down
4 changes: 3 additions & 1 deletion 6/Dockerfile.c9s
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ Varnish Cache stores web pages in memory so web servers don't have to create \
the same web page over and over again. Varnish Cache serves pages much faster \
than any application server; giving the website a significant speed up." \
VARNISH_VCL=/etc/varnish/default.vcl \
VARNISH_CONFIGURATION_PATH=/etc/varnish
VARNISH_CONFIGURATION_PATH=/etc/varnish \
VARNISH_VERSION=6

LABEL summary="$SUMMARY" \
description="$DESCRIPTION" \
Expand All @@ -29,6 +30,7 @@ RUN INSTALL_PKGS="gettext hostname nss_wrapper bind-utils varnish gcc" && \
rpm -V $INSTALL_PKGS && \
fix-permissions $VARNISH_CONFIGURATION_PATH && \
fix-permissions /var/lib/varnish && \
varnishd -V 2>&1 | grep -qe "varnish-$VARNISH_VERSION\." && echo "Found VERSION $VARNISH_VERSION" && \
rm -f /etc/profile.d/lang.sh && \
rm -f /etc/profile.d/lang.csh && \
yum -y clean all --enablerepo='*'
Expand Down
4 changes: 3 additions & 1 deletion 6/Dockerfile.rhel7
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ Varnish Cache stores web pages in memory so web servers don't have to create \
the same web page over and over again. Varnish Cache serves pages much faster \
than any application server; giving the website a significant speed up." \
VARNISH_VCL=/etc/opt/rh/rh-varnish6/varnish/default.vcl \
VARNISH_CONFIGURATION_PATH=/etc/opt/rh/rh-varnish6/varnish
VARNISH_CONFIGURATION_PATH=/etc/opt/rh/rh-varnish6/varnish \
VARNISH_VERSION=6

LABEL summary="$SUMMARY" \
description="$DESCRIPTION" \
Expand All @@ -28,6 +29,7 @@ RUN INSTALL_PKGS="gettext hostname nss_wrapper bind-utils rh-varnish6-varnish gc
prepare-yum-repositories rhel-server-rhscl-7-rpms && \
yum -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \
rpm -V $INSTALL_PKGS && \
scl enable rh-varnish$VARNISH_VERSION -- varnishd -V 2>&1 | grep -qe "varnish-$VARNISH_VERSION\." && echo "Found VERSION $VARNISH_VERSION" && \
rm -f /etc/profile.d/lang.sh && \
rm -f /etc/profile.d/lang.csh && \
yum -y clean all --enablerepo='*'
Expand Down
4 changes: 3 additions & 1 deletion 6/Dockerfile.rhel8
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ Varnish Cache stores web pages in memory so web servers don't have to create \
the same web page over and over again. Varnish Cache serves pages much faster \
than any application server; giving the website a significant speed up." \
VARNISH_VCL=/etc/varnish/default.vcl \
VARNISH_CONFIGURATION_PATH=/etc/varnish
VARNISH_CONFIGURATION_PATH=/etc/varnish \
VARNISH_VERSION=6

LABEL summary="$SUMMARY" \
description="$DESCRIPTION" \
Expand All @@ -30,6 +31,7 @@ RUN INSTALL_PKGS="gettext hostname nss_wrapper bind-utils varnish gcc" && \
rpm -V $INSTALL_PKGS && \
fix-permissions $VARNISH_CONFIGURATION_PATH && \
fix-permissions /var/lib/varnish && \
varnishd -V 2>&1 | grep -qe "varnish-$VARNISH_VERSION\." && echo "Found VERSION $VARNISH_VERSION" && \
rm -f /etc/profile.d/lang.sh && \
rm -f /etc/profile.d/lang.csh && \
yum -y clean all --enablerepo='*'
Expand Down
4 changes: 3 additions & 1 deletion 6/Dockerfile.rhel9
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ Varnish Cache stores web pages in memory so web servers don't have to create \
the same web page over and over again. Varnish Cache serves pages much faster \
than any application server; giving the website a significant speed up." \
VARNISH_VCL=/etc/varnish/default.vcl \
VARNISH_CONFIGURATION_PATH=/etc/varnish
VARNISH_CONFIGURATION_PATH=/etc/varnish \
VARNISH_VERSION=6

LABEL summary="$SUMMARY" \
description="$DESCRIPTION" \
Expand All @@ -29,6 +30,7 @@ RUN INSTALL_PKGS="gettext hostname nss_wrapper bind-utils varnish gcc" && \
rpm -V $INSTALL_PKGS && \
fix-permissions $VARNISH_CONFIGURATION_PATH && \
fix-permissions /var/lib/varnish && \
varnishd -V 2>&1 | grep -qe "varnish-$VARNISH_VERSION\." && echo "Found VERSION $VARNISH_VERSION" && \
rm -f /etc/profile.d/lang.sh && \
rm -f /etc/profile.d/lang.csh && \
yum -y clean all --enablerepo='*'
Expand Down
4 changes: 3 additions & 1 deletion 7/Dockerfile.fedora
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ the same web page over and over again. Varnish Cache serves pages much faster \
than any application server; giving the website a significant speed up." \
VERSION=0 \
VARNISH_VCL=/etc/varnish/default.vcl \
VARNISH_CONFIGURATION_PATH=/etc/varnish
VARNISH_CONFIGURATION_PATH=/etc/varnish \
VARNISH_VERSION=7

LABEL summary="$SUMMARY" \
description="$DESCRIPTION" \
Expand All @@ -29,6 +30,7 @@ RUN INSTALL_PKGS="gettext hostname nss_wrapper bind-utils varnish" && \
rpm -V $INSTALL_PKGS && \
fix-permissions $VARNISH_CONFIGURATION_PATH && \
fix-permissions /var/lib/varnish && \
varnishd -V 2>&1 | grep -qe "varnish-$VARNISH_VERSION\." && echo "Found VERSION $VARNISH_VERSION" && \
rm -f /etc/profile.d/lang.sh && \
rm -f /etc/profile.d/lang.csh && \
dnf -y clean all --enablerepo='*'
Expand Down
7 changes: 6 additions & 1 deletion src/Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ running Varnish server or building Varnish-based application. \
Varnish Cache stores web pages in memory so web servers don't have to create \
the same web page over and over again. Varnish Cache serves pages much faster \
than any application server; giving the website a significant speed up." \
{{ macros.env(config, spec) }}
{{ macros.env(config, spec) }} \
VARNISH_VERSION={{ spec.version }}

LABEL summary="$SUMMARY" \
description="$DESCRIPTION" \
Expand All @@ -34,6 +35,10 @@ RUN {{ macros.populate_install_pkgs(spec) }}
{% if config.os.id == "fedora" or spec.prod == "rhel8" or spec.prod == "rhel9" or spec.prod == "c8s" 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 && \
Expand Down