feat: PHP 8.6 for cac and cac-fpm (Remi php:remi-8.6), per-family version lists in plan-legs
install-php86.sh = install-php85.sh minus php-pecl-geoip (no 8.6 build), fail-loud with extension assertion. plan-legs.sh: per-family lists so cac/cac-fpm get 82-86 while cac-litespeed/cac-lsphp stay 82-85 (no lsphp86). :latest stays on php85. ini files are shared (single prod-php.ini), so 8.5 hardening incl. session.use_strict_mode=0 applies unchanged. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0185ukXi4YX5FxJGqhi6qab6
This commit is contained in:
1 parent
e6e3f1fd48
commit
854042b1c3
5 files changed
+60
-19
No files matched your search
Executable
+15
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
# PHP 8.6 (Remi EL10 modular php:remi-8.6). Same package set as install-php85.sh
|
||||
# MINUS php-pecl-geoip: Remi has no 8.6 build of it (and PECL GeoIP is dead
|
||||
# upstream). Fails loudly (set -e) instead of the older scripts' "exit 0".
|
||||
set -euo pipefail
|
||||
dnf module enable php:remi-8.6 -y
|
||||
dnf install -y php php-fpm php-mysqlnd php-xml php-pecl-zip php-sodium php-soap php-pecl-xmlrpc \
|
||||
php-pecl-redis5 php-pecl-memcached php-pecl-memcache php-pecl-ip2location php-pecl-imagick \
|
||||
php-mysqlnd php-mbstring php-intl php-gd php-pgsql libzip php-cli
|
||||
# A silently missing extension must fail the build, not ship.
|
||||
loaded=$(php -m)
|
||||
for ext in mysqlnd gd intl soap sodium zip mbstring xml pgsql redis memcached memcache imagick ip2location xmlrpc; do
|
||||
printf '%s\n' "$loaded" | grep -qix "$ext" || { echo "FATAL: PHP 8.6 extension '$ext' not loaded" >&2; exit 1; }
|
||||
done
|
||||
exit 0
|
||||
@@ -136,7 +136,7 @@ class Wiring(unittest.TestCase):
|
||||
st = step(self.jobs[j], 'Assemble')
|
||||
script = re.search(r'run: \|\n((?: .*\n?)+)', st).group(1)
|
||||
script = '\n'.join(l[10:] for l in script.split('\n'))
|
||||
for ver in (['82', '83', '84', '85'] if matrix else ['']):
|
||||
for ver in (['82', '83', '84', '85', '86'] if matrix else ['']):
|
||||
with tempfile.TemporaryDirectory() as d:
|
||||
os.makedirs(os.path.join(d, 'scripts'))
|
||||
stub = os.path.join(d, 'scripts', 'assemble-multiarch-index.sh')
|
||||
@@ -171,7 +171,8 @@ class Wiring(unittest.TestCase):
|
||||
|
||||
# ---- single-leg dispatch (workflow_dispatch input `only`, plan job) ----------------------
|
||||
PLAN = os.path.join(ROOT, '.gitea', 'scripts', 'plan-legs.sh')
|
||||
FULL = '[82,83,84,85]'
|
||||
FULL = '[82,83,84,85]' # LiteSpeed families
|
||||
FULL86 = '[82,83,84,85,86]' # cac / cac-fpm (Remi) also ship 8.6
|
||||
# image job -> (plan output, matrix?)
|
||||
LEGS = {
|
||||
'Build-and-Push': ('cac', True),
|
||||
@@ -183,7 +184,7 @@ LEGS = {
|
||||
}
|
||||
EMPTY = {'cac': '[]', 'cac_fpm': '[]', 'cac_litespeed': '[]', 'cac_lsphp': '[]',
|
||||
'shared_httpd': 'false', 'shared_ols': 'false'}
|
||||
EVERYTHING = {'cac': FULL, 'cac_fpm': FULL, 'cac_litespeed': FULL, 'cac_lsphp': FULL,
|
||||
EVERYTHING = {'cac': FULL86, 'cac_fpm': FULL86, 'cac_litespeed': FULL, 'cac_lsphp': FULL,
|
||||
'shared_httpd': 'true', 'shared_ols': 'true'}
|
||||
|
||||
|
||||
@@ -262,9 +263,11 @@ class SingleLegDispatch(unittest.TestCase):
|
||||
self.assertEqual((rc, kv), (0, EVERYTHING), (only, err))
|
||||
|
||||
def test_full_matrix_equals_the_old_literal(self):
|
||||
# the pre-change matrix was `phpver: [82, 83, 84, 85]`
|
||||
# the pre-86 matrix was `phpver: [82, 83, 84, 85]`; the LiteSpeed families keep it
|
||||
rc, kv, _ = plan(None)
|
||||
self.assertEqual([int(x) for x in kv['cac'].strip('[]').split(',')], [82, 83, 84, 85])
|
||||
self.assertEqual([int(x) for x in kv['cac'].strip('[]').split(',')], [82, 83, 84, 85, 86])
|
||||
for fam in ('cac_litespeed', 'cac_lsphp'):
|
||||
self.assertEqual([int(x) for x in kv[fam].strip('[]').split(',')], [82, 83, 84, 85], fam)
|
||||
|
||||
def test_single_leg(self):
|
||||
rc, kv, _ = plan('cac:php85')
|
||||
@@ -287,7 +290,21 @@ class SingleLegDispatch(unittest.TestCase):
|
||||
|
||||
def test_family_name_means_every_version(self):
|
||||
rc, kv, _ = plan('cac-fpm')
|
||||
self.assertEqual((rc, kv), (0, dict(EMPTY, cac_fpm=FULL)))
|
||||
self.assertEqual((rc, kv), (0, dict(EMPTY, cac_fpm=FULL86)))
|
||||
rc, kv, _ = plan('cac-lsphp')
|
||||
self.assertEqual((rc, kv), (0, dict(EMPTY, cac_lsphp=FULL)))
|
||||
rc, kv, _ = plan('cac-litespeed')
|
||||
self.assertEqual((rc, kv), (0, dict(EMPTY, cac_litespeed=FULL)))
|
||||
|
||||
def test_php86_only_for_remi_families(self):
|
||||
rc, kv, _ = plan('cac:php86')
|
||||
self.assertEqual((rc, kv), (0, dict(EMPTY, cac='[86]')))
|
||||
rc, kv, _ = plan('cac-fpm:php86')
|
||||
self.assertEqual((rc, kv), (0, dict(EMPTY, cac_fpm='[86]')))
|
||||
for fam in ('cac-litespeed', 'cac-lsphp'):
|
||||
rc, kv, err = plan(fam + ':php86')
|
||||
self.assertEqual((rc, kv), (2, {}), fam)
|
||||
self.assertIn('plan-legs:', err)
|
||||
|
||||
def test_comma_list_spaces_duplicates_and_ordering(self):
|
||||
rc, kv, _ = plan(' cac:php85 , cac:php82,cac:php85, shared-httpd ,')
|
||||
@@ -296,7 +313,7 @@ class SingleLegDispatch(unittest.TestCase):
|
||||
self.assertEqual((rc, kv), (0, dict(EMPTY, cac='[85]', cac_fpm='[84]')))
|
||||
|
||||
def test_unknown_values_fail_loudly_and_emit_nothing(self):
|
||||
bad = ['foo', 'cac:php99', 'cac:85', 'cac:php8', 'CAC:php85', 'cac:', 'cac:php85:x', 'php85',
|
||||
bad = ['foo', 'cac:php99', 'cac:php87', 'cac-lsphp:php86', 'cac-litespeed:php86', 'cac:85', 'cac:php8', 'CAC:php85', 'cac:', 'cac:php85:x', 'php85',
|
||||
'shared-httpd:php85', 'shared-ols:latest', ',', ' , ', 'cac:php85,nope',
|
||||
'cac:php85;rm -rf x', '$(id)', 'all', 'latest']
|
||||
for only in bad:
|
||||
|
||||
Reference in new issue
Block a user