Skip to content
Snippets Groups Projects
Commit 84ecb065 authored by Stevan Radaković's avatar Stevan Radaković
Browse files

sysota: Use bundle job name in CI instead of build job name for rauc bundles


Using build job name to download bundles doesn't work. We need to introduce
new var and make it mandatory for lava jobs containing the `sysota`
in job name.

Signed-off-by: default avatarStevan Radaković <stevan.radakovic@linaro.org>
parent e81ef83c
No related branches found
No related tags found
1 merge request!247sysota: Use bundle job name in CI instead of build job name for rauc bundles
...@@ -477,6 +477,7 @@ lava-qemu-x86-sysota: ...@@ -477,6 +477,7 @@ lava-qemu-x86-sysota:
CI_BUILD_JOB_NAME: linux-qemu-x86 CI_BUILD_JOB_NAME: linux-qemu-x86
CI_LAVA_JOB_DEFINITION: "https://git.ostc-eu.org/OSTC/infrastructure/lava/lava-config/-/raw/master/lava.ostc-eu.org/job-definitions/ci/qemu-x86-sysota.yaml" CI_LAVA_JOB_DEFINITION: "https://git.ostc-eu.org/OSTC/infrastructure/lava/lava-config/-/raw/master/lava.ostc-eu.org/job-definitions/ci/qemu-x86-sysota.yaml"
CI_REPORT_JOB_NAME: lava-report CI_REPORT_JOB_NAME: lava-report
CI_UPDATE_JOB_NAME: bundle-qemu-x86
lava-qemu-x86_64-sysota: lava-qemu-x86_64-sysota:
needs: [bundle-qemu-x86_64] needs: [bundle-qemu-x86_64]
...@@ -487,6 +488,7 @@ lava-qemu-x86_64-sysota: ...@@ -487,6 +488,7 @@ lava-qemu-x86_64-sysota:
CI_BUILD_JOB_NAME: linux-qemu-x86_64 CI_BUILD_JOB_NAME: linux-qemu-x86_64
CI_LAVA_JOB_DEFINITION: "https://git.ostc-eu.org/OSTC/infrastructure/lava/lava-config/-/raw/master/lava.ostc-eu.org/job-definitions/ci/qemu-x86_64-sysota.yaml" CI_LAVA_JOB_DEFINITION: "https://git.ostc-eu.org/OSTC/infrastructure/lava/lava-config/-/raw/master/lava.ostc-eu.org/job-definitions/ci/qemu-x86_64-sysota.yaml"
CI_REPORT_JOB_NAME: lava-report CI_REPORT_JOB_NAME: lava-report
CI_UPDATE_JOB_NAME: bundle-qemu-x86_64
lava-report: lava-report:
extends: .lava-report extends: .lava-report
......
...@@ -33,11 +33,19 @@ ...@@ -33,11 +33,19 @@
- test -n "$CI_REPORT_JOB_NAME" || ( - test -n "$CI_REPORT_JOB_NAME" || (
echo "precondition failed - set CI_REPORT_JOB_NAME to the CI job name which will gather results back from LAVA" echo "precondition failed - set CI_REPORT_JOB_NAME to the CI job name which will gather results back from LAVA"
&& exit 1 ) && exit 1 )
# If the test job name contains 'sysota', usage of update job name is
# required.
- |
if [[ -z "$CI_UPDATE_JOB_NAME" ]] && [[ "$CI_JOB_NAME" == *"sysota"* ]]; then
echo "precondition failed - jobs with 'sysota' in their name must have CI_UPDATE_JOB_NAME variable with the name of the 'update' CI job that contains rauc bundles"
exit 1
fi
script: script:
# Build callback URL for the "report" job # Build callback URL for the "report" job
- curl --silent "$CI_API_V4_URL/projects/$CI_PROJECT_ID/pipelines/$CI_PIPELINE_ID/jobs?per_page=100" > jobs-manual.json - curl --silent "$CI_API_V4_URL/projects/$CI_PROJECT_ID/pipelines/$CI_PIPELINE_ID/jobs?per_page=100" > jobs-manual.json
- job_id="$(jq -r ".[] | select(.name == \"$CI_REPORT_JOB_NAME\") | .id" jobs-manual.json)" - job_id="$(jq -r ".[] | select(.name == \"$CI_REPORT_JOB_NAME\") | .id" jobs-manual.json)"
- build_job_id="$(jq -r ".[] | select(.name == \"$CI_BUILD_JOB_NAME\") | .id" jobs-manual.json)" - build_job_id="$(jq -r ".[] | select(.name == \"$CI_BUILD_JOB_NAME\") | .id" jobs-manual.json)"
- update_job_id="$(jq -r ".[] | select(.name == \"$CI_UPDATE_JOB_NAME\") | .id" jobs-manual.json)"
- CALLBACK_URL="$CI_API_V4_URL/projects/$CI_PROJECT_ID/jobs/${job_id}/play" - CALLBACK_URL="$CI_API_V4_URL/projects/$CI_PROJECT_ID/jobs/${job_id}/play"
# Get the job definition from remote source. # Get the job definition from remote source.
- curl --silent "$CI_LAVA_JOB_DEFINITION" > job_def.yaml - curl --silent "$CI_LAVA_JOB_DEFINITION" > job_def.yaml
...@@ -46,6 +54,7 @@ ...@@ -46,6 +54,7 @@
-e 's/@ci_project_id@/'"$CI_PROJECT_ID"'/' -e 's/@ci_project_id@/'"$CI_PROJECT_ID"'/'
-e 's/@ci_pipeline_id@/'"$CI_PIPELINE_ID"'/' -e 's/@ci_pipeline_id@/'"$CI_PIPELINE_ID"'/'
-e 's,@ci_pipeline_url@,'"$CI_PIPELINE_URL"',' -e 's,@ci_pipeline_url@,'"$CI_PIPELINE_URL"','
-e 's,@update_job_id@,'"$update_job_id"','
-e 's/@build_job_id@/'"$build_job_id"'/' job_def.yaml -e 's/@build_job_id@/'"$build_job_id"'/' job_def.yaml
# Update the job with device configuration # Update the job with device configuration
- sed -i -e 's/@BOARD_RAM_SIZE@/'"$BOARD_RAM_SIZE"'/g' job_def.yaml - sed -i -e 's/@BOARD_RAM_SIZE@/'"$BOARD_RAM_SIZE"'/g' job_def.yaml
......
...@@ -45,6 +45,12 @@ The name of the ``report`` job which will be triggered manually when the LAVA ...@@ -45,6 +45,12 @@ The name of the ``report`` job which will be triggered manually when the LAVA
job(s) are finished with executution. This job will collect the results from job(s) are finished with executution. This job will collect the results from
LAVA and import them to GitLab. LAVA and import them to GitLab.
CI_UPDATE_JOB_NAME
------------------
The name of the ``update`` job which LAVA needs in order to download the
correct SySOTA bundle from the pipeline.
CI_LAVA_INSTANCE CI_LAVA_INSTANCE
---------------- ----------------
......
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