Skip to content
Snippets Groups Projects
Commit 8c7c03d1 authored by Andrej Shadura's avatar Andrej Shadura Committed by Walter Lozano
Browse files

Only pass CI_JOB_TOKEN when using custom images.


Set image_needs_job_token when generating jobs and only pass
CI_JOB_TOKEN when it’s defined. This avoids having to work around
it when CI_JOB_TOKEN is not necessary and the job definition is used
e.g. with lava-submit/lqa which do not support "job" variable.

Signed-off-by: default avatarAndrej Shadura <andrew.shadura@collabora.co.uk>
parent 98c233f3
No related branches found
No related tags found
1 merge request!599Backport v2024 <- v2025dev1: Only pass CI_JOB_TOKEN when using custom images.
Pipeline #687510 passed
......@@ -93,6 +93,7 @@ def run_generate_jobs(test_meta, args, image_type, arch, board=None):
if test_meta.get("build-custom-image"):
gen_jobs.extend(['-t', 'image_base_url:{{job.BUILT_IMAGE_URL}}'])
gen_jobs.extend(['-t', 'image_needs_job_token:true'])
generate_image_job(release, arch, board, osname, image_type, image_buildid, image_name, bin_pkg_list)
subprocess.run(gen_jobs)
......
......@@ -91,12 +91,16 @@ actions:
images:
image:
url: {{boot.image_url('gz')}}
{%- if image_needs_job_token is defined %}
headers:
JOB-TOKEN: {% raw %}{{job.CI_JOB_TOKEN}}{% endraw %}
{% endif %}
bmap:
url: {{boot.image_url('bmap')}}
{%- if image_needs_job_token is defined %}
headers:
JOB-TOKEN: {% raw %}{{job.CI_JOB_TOKEN}}{% endraw %}
{% endif %}
uniquify: false
os: apertis
writer:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment