Consolidating Duplicate Delivery Pipelines with Parameters and Build Tags
As a developer, have you ever found yourself managing multiple delivery pipelines that seem to do the same thing? Perhaps they're built on top of the same underlying architecture, but with slight variations in configuration or dependencies. In this article, we'll explore how I consolidated these duplicate pipelines using parameters and build tags.
The Problem of Duplicate Pipelines
We've all been there - staring at a list of identical-looking pipelines in our CI/CD tooling, each with their own set of triggers, steps, and configurations. It's not uncommon for developers to create new pipelines for every small variation in deployment requirements. But this approach can lead to a plethora of issues:
- Maintenance Hell: With multiple pipelines to update, maintain, and troubleshoot, it's easy to get lost in the weeds.
- Configuration Chaos: Duplicate configurations lead to inconsistencies and make it difficult to track changes across environments.
- Resource Waste: Multiple pipelines consume more resources (e.g., compute power, storage) than necessary.
The Solution: Parameters and Build Tags
To address these issues, I turned to parameters and build tags. These two features allowed me to create a single pipeline that could be configured for different scenarios without duplicating effort.
Parameters
Parameters enable you to inject variables into your pipeline at runtime. This is useful when you need to tweak specific settings or dependencies on a per-environment basis. By parameterizing sensitive information, such as database credentials or API keys, I was able to reduce the risk of exposing sensitive data in my pipelines.
Here's an example of how I used parameters to configure different deployment targets:
parameters:
- name: environment
description: The target environment (e.g., dev, staging, prod)
default: 'dev'
Build Tags
Build tags allow you to associate metadata with your builds. This is particularly useful when working with multiple pipelines that share similar steps or dependencies.
By applying build tags to my pipeline runs, I could track which environments and configurations were used for each deployment:
buildTags:
- name: 'environment'
value: 'dev'
- name: 'configuration'
value: 'standard'
Consolidating Duplicate Pipelines
With parameters and build tags in place, it was time to refactor my duplicate pipelines into a single, more maintainable pipeline.
Here's an overview of the consolidation process:
- Identify commonalities: Determine which steps and dependencies are shared across the duplicate pipelines.
- Parameterize configurations: Use parameters to inject environment-specific settings and credentials.
- Apply build tags: Associate metadata with each pipeline run using build tags.
- Refactor pipeline structure: Streamline the pipeline's logic by removing duplicated code.
Benefits of Consolidation
By consolidating my duplicate pipelines, I achieved several benefits:
- Reduced maintenance overhead: With a single pipeline to update and maintain, I saved time and effort.
- Improved configuration consistency: Parameters ensured that configurations were applied consistently across environments.
- Increased resource efficiency: Fewer pipelines meant reduced compute power and storage consumption.
Conclusion
Consolidating duplicate delivery pipelines with parameters and build tags is a simple yet effective way to streamline your CI/CD workflow. By embracing this approach, you can reduce maintenance overhead, improve configuration consistency, and increase resource efficiency - all while maintaining the flexibility to adapt to changing deployment requirements.
By Malik Abualzait

Top comments (0)