From c227e0531a0b9c6a2b23f6ec27ad0afe4bdac8c2 Mon Sep 17 00:00:00 2001 From: Tim Jaacks <tim.jaacks@seco.com> Date: Mon, 24 Jul 2023 09:03:38 +0200 Subject: [PATCH] Yocto build: use common artifact pathspec for image and SDK builds This is the first step on the way to a common pipeline for all build configurations. --- build-common.yml | 25 ++++++++----------------- build-jobs-ci-test.yml.jinja2 | 12 ++++++------ build-yocto.yml | 2 -- 3 files changed, 14 insertions(+), 25 deletions(-) diff --git a/build-common.yml b/build-common.yml index 25bc4d63..e0a0948b 100644 --- a/build-common.yml +++ b/build-common.yml @@ -98,29 +98,20 @@ workflow: expire_in: 1 week reports: dotenv: build.env - -.build_image: - artifacts: - paths: &build_image_artifacts_paths + paths: &artifacts_paths + # List of all potential artifact paths. Not all of them are present in each build + # configuration, e.g. the SDK path exists in SDK builds only. We still specify all + # of them here in order to have a generic build class for all builds. Pathsspecs + # which do not exist in a specific configuration are simply ignored by GitLab. - build-*/tmp/deploy/images/**/* - build-*/tmp/deploy/licenses/**/license.manifest - - build.env - cache: - # Cache the build artifacts for subsequent stages in the same pipeline - - key: ${CI_PIPELINE_ID}-${CI_JOB_NAME} - policy: push - paths: *build_image_artifacts_paths - -.build_sdk: - artifacts: - paths: &build_sdk_artifacts_paths - build-*/tmp/deploy/sdk/* - build.env cache: # Cache the build artifacts for subsequent stages in the same pipeline - key: ${CI_PIPELINE_ID}-${CI_JOB_NAME} policy: push - paths: *build_sdk_artifacts_paths + paths: *artifacts_paths # -------------------------------------------------------------------------------------- # Stage: test @@ -218,7 +209,7 @@ workflow: --release-suffix="${RELEASE_SUFFIX}" cache: - <<: *pull_build_cache - paths: *build_image_artifacts_paths + paths: *artifacts_paths - *push_package_cache .package_sdk: @@ -232,7 +223,7 @@ workflow: --release-suffix="${RELEASE_SUFFIX}" cache: - <<: *pull_build_cache - paths: *build_sdk_artifacts_paths + paths: *artifacts_paths - *push_package_cache # -------------------------------------------------------------------------------------- diff --git a/build-jobs-ci-test.yml.jinja2 b/build-jobs-ci-test.yml.jinja2 index 04dced65..ce9603f7 100644 --- a/build-jobs-ci-test.yml.jinja2 +++ b/build-jobs-ci-test.yml.jinja2 @@ -114,32 +114,32 @@ build:check-foo-branch: simulate-build-seco-mx6: extends: - .simulate_build - - .build_image + - .buildbase variables: # We have to specify a tag here instead of getting the artifacts from a master # branch, because we don't always execute the full pipeline on the master branches. # In those cases the actual build job does not exist, which results in a 404 error. BUILD_ARTIFACTS: https://git.seco.com/seco-ne/yocto/manifest/-/jobs/artifacts/kirkstone/3.0/download?job=build-seco-mx6 cache: - - !reference [.build_image, cache] + - !reference [.buildbase, cache] # Additionally cache the build artifacts for re-runs of this job in other pipelines - key: ${CI_JOB_NAME}-${BUILD_ARTIFACTS} - paths: !reference [.build_image, artifacts, paths] + paths: !reference [.buildbase, artifacts, paths] simulate-buildsdk-seco-mx6: extends: - .simulate_build - - .build_sdk + - .buildbase rules: - when: manual allow_failure: true variables: BUILD_ARTIFACTS: https://git.seco.com/seco-ne/yocto/manifest/-/jobs/artifacts/kirkstone/3.0/download?job=buildsdk-seco-mx6 cache: - - !reference [.build_sdk, cache] + - !reference [.buildbase, cache] # Additionally cache the build artifacts for re-runs of this job in other pipelines - key: ${CI_JOB_NAME}-${BUILD_ARTIFACTS} - paths: !reference [.build_sdk, artifacts, paths] + paths: !reference [.buildbase, artifacts, paths] # -------------------------------------------------------------------------------------- # Stage: Test diff --git a/build-yocto.yml b/build-yocto.yml index 7573ffaa..adb090f2 100644 --- a/build-yocto.yml +++ b/build-yocto.yml @@ -92,7 +92,6 @@ .build_yocto_image: extends: - .build_yocto - - .build_image variables: BITBAKE_TASK: "build" script: @@ -104,7 +103,6 @@ .build_yocto_sdk: extends: - .build_yocto - - .build_sdk variables: BITBAKE_TASK: "populate_sdk" rules: -- GitLab