Skip to content

CI: keep latest build artifacts for manifest repo

Dmitry Petrov requested to merge keep_artifacts into master

This is a solution for [YT-54] CI: Make sure the latest manifest pipeline with artifacts is not deleted.

After initial investigation of the problem we failed to find a straightforward solution, but proposed two workarounds:

  • always trigger full build from default branch;
  • to develop a script to manage build artifacts.

(See comments to discussion on JIRA for more details).

Due to lack of feedback, we decided we proceed with option #2 - we developed a python script and wrapped it with corresponding GitLab CI job to launch it.

The script searches for the latest pipelines for default branch in manifest repository and decides either to keep or delete artifacts for particular build. Herewith the build artifacts are kept for:

  • the latest commit;
  • the last successful build;
  • the tagged commits (e.g. fngsystem/47.0, kirkstone/20.0).

Example run: https://git.seco.com/seco-ne/yocto/layers/meta-seconorth-distro/-/jobs/904024
Note: for testing purpose the job was defined in manifest-integration-jobs.yml but the real place for the job is in manifest-pipeline.yml (next to the retrigger job).

Edited by Dmitry Petrov

Merge request reports