fix: improve registry URL regex to exclude image names with tags
Some checks failed
🚀 Build & Deploy Image / Determine Build Necessity (push) Successful in 26s
Security Vulnerability Scan / Check for Dependency Changes (push) Successful in 25s
🚀 Build & Deploy Image / Build Runtime Base Image (push) Successful in 13s
🚀 Build & Deploy Image / Run Tests & Quality Checks (push) Has been skipped
Security Vulnerability Scan / Composer Security Audit (push) Has been skipped
🚀 Build & Deploy Image / Build Docker Image (push) Successful in 12s
🚀 Build & Deploy Image / Auto-deploy to Staging (push) Failing after 1m8s
🚀 Build & Deploy Image / Auto-deploy to Production (push) Has been skipped

The previous regex matched 'redis:7-alpine' because it saw ':7' as a port.
New regex requires:
- TLD with optional port (e.g. git.michaelschiemer.de:5000)
- Hostname with numeric port only (e.g. localhost:5000)
- localhost with optional port

This excludes image names like 'redis:7-alpine' or 'minio/minio:latest'.
This commit is contained in:
2025-11-09 00:13:33 +01:00
parent b9437ed68a
commit f33182539f

View File

@@ -248,7 +248,7 @@
ansible.builtin.set_fact: ansible.builtin.set_fact:
registries_to_login: >- registries_to_login: >-
{%- set found_registries = actual_registry_urls_full.stdout | trim | split('\n') | select('match', '.+') | list -%} {%- set found_registries = actual_registry_urls_full.stdout | trim | split('\n') | select('match', '.+') | list -%}
{%- set filtered_registries = found_registries | select('match', '.*\.(de|com|org|net|io|dev).*|.*:[0-9]+.*|^localhost$') | list -%} {%- set filtered_registries = found_registries | select('match', '.*\.(de|com|org|net|io|dev)(:[0-9]+)?$|^[^:]+:[0-9]+$|^localhost(:[0-9]+)?$') | list -%}
{%- set default_registry = [docker_registry] -%} {%- set default_registry = [docker_registry] -%}
{%- if filtered_registries | length > 0 -%} {%- if filtered_registries | length > 0 -%}
{{ filtered_registries | unique | list }} {{ filtered_registries | unique | list }}