1
Fork 0

feat: Add registry mirror

Fixes: #39
This commit is contained in:
Lucas Schwiderski 2024-08-28 11:51:27 +02:00
parent 3ed0626d0d
commit 2432154339
Signed by: lucas
GPG key ID: AA12679AAA6DF4D8
4 changed files with 16 additions and 10 deletions

View file

@ -52,10 +52,10 @@ resources:
jobs:
{%- for img in images %}
{%- if img.type == "simple" %}
{{ simple_image.jobs(img) }}
{{ simple_image.jobs(img, registry_url) }}
{%- elif img.type == "file" %}
{%- import "jobs/" + img.name + ".yml.j2" as job %}
{{ job.jobs() }}
{{ job.jobs(registry_url) }}
{%- endif %}
{% endfor %}

View file

@ -7,7 +7,7 @@
tag: latest
{% endmacro %}
{% macro build(variant) -%}
{% macro build(variant, registry_url) -%}
- task: build-gitea-{{ variant }}
file: repo/tasks/build-image.yml
privileged: true
@ -17,6 +17,7 @@
dockerfile: ''
params:
BUILD_ARG_VARIANT: {{ variant }}
REGISTRY_MIRRORS: {{ registry_url }}
output_mapping:
image: image-gitea-{{ variant }}
{% endmacro %}
@ -45,7 +46,7 @@
{{ resource('pr', registry_url) }}
{% endmacro %}
{% macro jobs() -%}
{% macro jobs(registry_url) -%}
- name: gitea
serial: true
on_success:
@ -75,9 +76,9 @@
params:
state: pending
sha: ((.:git_sha))
{{ build('package') }}
{{ build('status') }}
{{ build('pr') }}
{{ build('package', registry_url) }}
{{ build('status', registry_url) }}
{{ build('pr', registry_url) }}
- in_parallel:
steps:
{{ put('package') }}

View file

@ -25,7 +25,7 @@
tag: latest
{% endmacro %}
{% macro jobs() -%}
{% macro jobs(registry_url) -%}
- name: rust-xwin
serial: true
on_success:
@ -62,6 +62,8 @@
context: repo/images/rust-xwin
target: rust-xwin
dockerfile: ''
params:
REGISTRY_MIRRORS: {{ registry_url }}
output_mapping:
image: image-rust-xwin
- task: build-rust-xwin-ci
@ -71,6 +73,8 @@
context: repo/images/rust-xwin
target: rust-xwin-ci
dockerfile: ''
params:
REGISTRY_MIRRORS: {{ registry_url }}
output_mapping:
image: image-rust-xwin-ci
- in_parallel:

View file

@ -1,4 +1,4 @@
{% macro jobs(job) -%}
{% macro jobs(job, registry_url) -%}
- name: {{ job.name }}
serial: true
on_success:
@ -35,8 +35,9 @@
context: repo/images/{{ job.name }}
dockerfile: ''
target: ''
{%- if "args" in job %}
params:
REGISTRY_MIRROR: {{ registry_url }}
{%- if "args" in job %}
{%- for name, value in job.args.items() %}
BUILD_ARG_{{name}}: "{{value}}"
{%- endfor %}