Skip to content
Closed
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
8 changes: 4 additions & 4 deletions .github/workflows/container-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
context_path: "simplerisk/"
dockerfile_path: "simplerisk/Dockerfile"
image_tag: "simplerisk/simplerisk:testing"
build_args: "ubuntu_version_code=jammy"
build_args: "ubuntu_version_code=jammy\nPREGA_BUNDLE_FALLBACK=true"

simplerisk-noble:
name: 'Verify simplerisk/simplerisk image based on Ubuntu 24.04 (Noble)'
Expand All @@ -22,7 +22,7 @@ jobs:
context_path: "simplerisk/"
dockerfile_path: "simplerisk/Dockerfile"
image_tag: "simplerisk/simplerisk:testing"
build_args: "ubuntu_version_code=noble"
build_args: "ubuntu_version_code=noble\nPREGA_BUNDLE_FALLBACK=true"

simplerisk-minimal-php84:
name: 'Verify simplerisk/simplerisk-minimal image based on PHP 8.3 with Apache'
Expand All @@ -31,7 +31,7 @@ jobs:
context_path: "simplerisk-minimal/"
dockerfile_path: "simplerisk-minimal/Dockerfile"
image_tag: "simplerisk/simplerisk-minimal:testing"
build_args: "php_version=8.3"
build_args: "php_version=8.3\nPREGA_BUNDLE_FALLBACK=true"

simplerisk-minimal-php85:
name: 'Verify simplerisk/simplerisk-minimal image based on PHP 8.4 with Apache'
Expand All @@ -40,4 +40,4 @@ jobs:
context_path: "simplerisk-minimal/"
dockerfile_path: "simplerisk-minimal/Dockerfile"
image_tag: "simplerisk/simplerisk-minimal:testing"
build_args: "php_version=8.4"
build_args: "php_version=8.4\nPREGA_BUNDLE_FALLBACK=true"
15 changes: 14 additions & 1 deletion simplerisk-minimal/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,23 @@ ARG php_version=8.4

FROM alpine/curl:8.12.1 AS downloader

# PREGA_BUNDLE_FALLBACK is a CI-ONLY switch, default false. bump_downstream opens
# the docker update-<version> PR at the testing cut, before that version's PROD
# bundle exists (it lands in public/bundles/ only at GA). container-validation
# sets this true so the PR can validate against the testing bundle. The GA publish
# leaves it FALSE, so a released image is ALWAYS built from the prod bundle and
# NEVER silently falls back to testing bytes (even on a transient prod failure).
ARG PREGA_BUNDLE_FALLBACK=false

SHELL [ "/bin/ash", "-eo", "pipefail", "-c" ]

RUN mkdir -p /var/www && \
curl -sL https://simplerisk-downloads.s3.amazonaws.com/public/bundles/simplerisk-20260519-001.tgz | tar xz -C /var/www
if curl -fsSL https://simplerisk-downloads.s3.amazonaws.com/public/bundles/simplerisk-20260519-001.tgz -o /tmp/bundle.tgz; then true; \
elif [ "$PREGA_BUNDLE_FALLBACK" = "true" ]; then \
echo "prod bundle absent — pre-GA CI fallback to bundles-test"; \
curl -fsSL https://bundles-test.simplerisk.com/simplerisk-20260519-001.tgz -o /tmp/bundle.tgz; \
else echo "prod bundle simplerisk-20260519-001.tgz not found and PREGA_BUNDLE_FALLBACK=false" && exit 1; fi && \
tar xzf /tmp/bundle.tgz -C /var/www && rm -f /tmp/bundle.tgz

FROM php:${php_version}-apache

Expand Down
15 changes: 14 additions & 1 deletion simplerisk-minimal/generate_dockerfile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,23 @@ if [ "$release" != "testing" ]; then
cat << EOF >> "${SCRIPT_LOCATION}/Dockerfile"
FROM alpine/curl:8.12.1 AS downloader

# PREGA_BUNDLE_FALLBACK is a CI-ONLY switch, default false. bump_downstream opens
# the docker update-<version> PR at the testing cut, before that version's PROD
# bundle exists (it lands in public/bundles/ only at GA). container-validation
# sets this true so the PR can validate against the testing bundle. The GA publish
# leaves it FALSE, so a released image is ALWAYS built from the prod bundle and
# NEVER silently falls back to testing bytes (even on a transient prod failure).
ARG PREGA_BUNDLE_FALLBACK=false

SHELL [ "/bin/ash", "-eo", "pipefail", "-c" ]

RUN mkdir -p /var/www && \\
curl -sL https://simplerisk-downloads.s3.amazonaws.com/public/bundles/simplerisk-$release.tgz | tar xz -C /var/www
if curl -fsSL https://simplerisk-downloads.s3.amazonaws.com/public/bundles/simplerisk-$release.tgz -o /tmp/bundle.tgz; then true; \\
elif [ "\$PREGA_BUNDLE_FALLBACK" = "true" ]; then \\
echo "prod bundle absent — pre-GA CI fallback to bundles-test"; \\
curl -fsSL https://bundles-test.simplerisk.com/simplerisk-$release.tgz -o /tmp/bundle.tgz; \\
else echo "prod bundle simplerisk-$release.tgz not found and PREGA_BUNDLE_FALLBACK=false" && exit 1; fi && \\
tar xzf /tmp/bundle.tgz -C /var/www && rm -f /tmp/bundle.tgz

EOF
fi
Expand Down
19 changes: 17 additions & 2 deletions simplerisk/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,27 @@ ARG ubuntu_version_code=noble
FROM alpine/curl:8.12.1 AS downloader

ARG DB_LANG=en
# PREGA_BUNDLE_FALLBACK is a CI-ONLY switch, default false. bump_downstream opens
# the docker update-<version> PR at the testing cut, before that version's PROD
# bundle + SQL exist (they land in public/bundles/ and database/master only at GA).
# container-validation sets this true so the PR can validate against the testing
# sources. The GA publish leaves it FALSE, so a released image is ALWAYS built from
# the prod bundle/SQL and NEVER silently falls back to testing bytes.
ARG PREGA_BUNDLE_FALLBACK=false

SHELL [ "/bin/ash", "-eo", "pipefail", "-c" ]

RUN mkdir -p /var/www && \
curl -sL https://simplerisk-downloads.s3.amazonaws.com/public/bundles/simplerisk-20260519-001.tgz | tar xz -C /var/www && \
curl -sL "https://github.com/simplerisk/database/raw/master/simplerisk-$DB_LANG-20260519-001.sql" > /simplerisk.sql
if curl -fsSL https://simplerisk-downloads.s3.amazonaws.com/public/bundles/simplerisk-20260519-001.tgz -o /tmp/bundle.tgz; then true; \
elif [ "$PREGA_BUNDLE_FALLBACK" = "true" ]; then \
echo "prod bundle absent — pre-GA CI fallback to bundles-test"; \
curl -fsSL https://bundles-test.simplerisk.com/simplerisk-20260519-001.tgz -o /tmp/bundle.tgz; \
else echo "prod bundle simplerisk-20260519-001.tgz not found and PREGA_BUNDLE_FALLBACK=false" && exit 1; fi && \
tar xzf /tmp/bundle.tgz -C /var/www && rm -f /tmp/bundle.tgz && \
if curl -fsSL "https://github.com/simplerisk/database/raw/master/simplerisk-$DB_LANG-20260519-001.sql" -o /simplerisk.sql; then true; \
elif [ "$PREGA_BUNDLE_FALLBACK" = "true" ]; then \
curl -fsSL "https://github.com/simplerisk/database/raw/testing/simplerisk-$DB_LANG-20260519-001.sql" -o /simplerisk.sql; \
else echo "prod SQL simplerisk-$DB_LANG-20260519-001.sql not found and PREGA_BUNDLE_FALLBACK=false" && exit 1; fi

# Using Ubuntu image
FROM ubuntu:${ubuntu_version_code}
Expand Down
19 changes: 17 additions & 2 deletions simplerisk/generate_dockerfile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,27 @@ if [ "$release" != "testing" ]; then
FROM alpine/curl:8.12.1 AS downloader

ARG DB_LANG=en
# PREGA_BUNDLE_FALLBACK is a CI-ONLY switch, default false. bump_downstream opens
# the docker update-<version> PR at the testing cut, before that version's PROD
# bundle + SQL exist (they land in public/bundles/ and database/master only at GA).
# container-validation sets this true so the PR can validate against the testing
# sources. The GA publish leaves it FALSE, so a released image is ALWAYS built from
# the prod bundle/SQL and NEVER silently falls back to testing bytes.
ARG PREGA_BUNDLE_FALLBACK=false

SHELL [ "/bin/ash", "-eo", "pipefail", "-c" ]

RUN mkdir -p /var/www && \\
curl -sL https://simplerisk-downloads.s3.amazonaws.com/public/bundles/simplerisk-$release.tgz | tar xz -C /var/www && \\
curl -sL "https://github.com/simplerisk/database/raw/master/simplerisk-\$DB_LANG-$release.sql" > /simplerisk.sql
if curl -fsSL https://simplerisk-downloads.s3.amazonaws.com/public/bundles/simplerisk-$release.tgz -o /tmp/bundle.tgz; then true; \\
elif [ "\$PREGA_BUNDLE_FALLBACK" = "true" ]; then \\
echo "prod bundle absent — pre-GA CI fallback to bundles-test"; \\
curl -fsSL https://bundles-test.simplerisk.com/simplerisk-$release.tgz -o /tmp/bundle.tgz; \\
else echo "prod bundle simplerisk-$release.tgz not found and PREGA_BUNDLE_FALLBACK=false" && exit 1; fi && \\
tar xzf /tmp/bundle.tgz -C /var/www && rm -f /tmp/bundle.tgz && \\
if curl -fsSL "https://github.com/simplerisk/database/raw/master/simplerisk-\$DB_LANG-$release.sql" -o /simplerisk.sql; then true; \\
elif [ "\$PREGA_BUNDLE_FALLBACK" = "true" ]; then \\
curl -fsSL "https://github.com/simplerisk/database/raw/testing/simplerisk-\$DB_LANG-$release.sql" -o /simplerisk.sql; \\
else echo "prod SQL simplerisk-\$DB_LANG-$release.sql not found and PREGA_BUNDLE_FALLBACK=false" && exit 1; fi

EOF
fi
Expand Down
Loading