diff --git a/pipelines/build-and-push.yml.j2 b/pipelines/build-and-push.yml.j2 index 6a8efd3..edec459 100644 --- a/pipelines/build-and-push.yml.j2 +++ b/pipelines/build-and-push.yml.j2 @@ -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 %} diff --git a/pipelines/jobs/gitea.yml.j2 b/pipelines/jobs/gitea.yml.j2 index 2b700c9..116e1e0 100644 --- a/pipelines/jobs/gitea.yml.j2 +++ b/pipelines/jobs/gitea.yml.j2 @@ -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') }} diff --git a/pipelines/jobs/rust-xwin.yml.j2 b/pipelines/jobs/rust-xwin.yml.j2 index 11d8bd8..aea0ad3 100644 --- a/pipelines/jobs/rust-xwin.yml.j2 +++ b/pipelines/jobs/rust-xwin.yml.j2 @@ -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: diff --git a/pipelines/jobs/simple-image.yml.j2 b/pipelines/jobs/simple-image.yml.j2 index 4cfbbb8..2eea0d9 100644 --- a/pipelines/jobs/simple-image.yml.j2 +++ b/pipelines/jobs/simple-image.yml.j2 @@ -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 %}