Always parameterize tool and runtime versions in CI/CD configurations rather than hardcoding them. This makes your pipelines more maintainable when dependencies need updates and provides a single source of truth for version requirements.
Always parameterize tool and runtime versions in CI/CD configurations rather than hardcoding them. This makes your pipelines more maintainable when dependencies need updates and provides a single source of truth for version requirements.
For critical dependencies like Node.js or package managers:
Example:
# Good practice
parameters:
maintenance-node-version:
type: string
default: "16.20"
jobs:
build:
docker:
- image: cimg/node:<< pipeline.parameters.maintenance-node-version >>
steps:
- run:
command: 'npm install -g npm@^8' # Version range for compatible updates
This approach helps prevent CI failures when new incompatible versions are released and simplifies the process of updating dependencies across multiple workflow steps.
Enter the URL of a public GitHub repository