Modernising CODE deployment to staging using Jenkins Pipeline

Jenkins Pipelines are the standard for managing workloads in Jenkins. Compared to Freestyle projects, they offer several advantages. They provide users with a clear and user-friendly view of the execution and evolution of their workloads, while allowing administrators to define and manage processes as code stored in a repository. This approach enables internal teams to collaborate on the pipeline code, review and propose changes, and maintain full traceability of modifications over time.

https://cpci.cbg.collabora.co.uk:8080/view/all/job/build_deploy_online_main_to_staging_perf/

Migrating legacy scripts executed as cron jobs on Linux hosts to Jenkins Pipelines allows us to benefit from all of these capabilities.

Jenkins also integrates seamlessly with Gerrit through the Gerrit Trigger Plugin, eliminating the need for polling mechanisms to detect new commits. In addition, by using the Lockable Resources Plugin, we can efficiently manage queued deployments and discard outdated builds in favor of newer commits.

For example, if ten commits are merged while a CODE deployment is already in progress, Jenkins can ensure that only the latest commit is eventually deployed, while the intermediate nine commits are skipped. This prevents unnecessary deployments, reduces resource consumption, and ensures that the environment is always updated with the most recent version of the code.