pipelinepulse
v1.0.4
Published
CI/CD orchestration tool with metric-driven canary deployments and self-healing capabilities
Maintainers
Readme
PipelinePulse
A lightweight yet powerful CI/CD orchestration tool with progressive rollouts, metric-based deployments, and self-healing capabilities.
Why PipelinePulse?
PipelinePulse integrates canary deployments and auto-rollbacks into your existing CI/CD pipeline without requiring a complete overhaul.
System Architecture
graph TD
CI[Your CI System] -->|Triggers| PP[PipelinePulse]
PP -->|Build/Test Commands| CI
PP -->|Deploy Commands| INFRA[Infrastructure<br/>K8s/Cloud/etc]
PP -->|Records State| DB[(Deployment<br/>History DB)]
PP -->|Reads Metrics| METRICS[Metrics Source]
METRICS -->|Feedback| PP
PP -->|Auto-Rollback| INFRAGetting Started
- Install the package:
npm install pipelinepulse - Create a configuration file (see Quick Start below)
- Run your pipeline with
npx pipelinepulse start pipeline.yaml - For programmatic usage, see the examples below
Features
Core Orchestration with Resilience
- Exponential backoff retry logic for command execution
- Concurrent execution of pipeline stages with configurable parallelism
- Timeout capability to prevent hung deployments
- Recovery from network failures and transient errors
Metric-Driven Deployments
- Progressive traffic percentage rollouts
- Metric evaluation with automated rollback thresholds
- Health checks during deployment
Self-Healing Auto-Rollback
- Automatic rollback when metrics exceed thresholds
- Configurable error thresholds with baseline comparison
- Immediate response to quality degradation without human intervention
State Persistence
- SQLite-based state persistence for deployment history
- Automatic recovery from crashes
- Comprehensive tracking of pipeline and stage execution
Observability
- Structured logging with component tagging
- Metrics for deployment success/failure rates and durations
- Lead time tracking for deployments
Security
- Injection Prevention: Validates commands to prevent security risks
- Config Validation: Blocks patterns like
curl | bashvia pattern matching - YAML Validation: Checks against MITRE ATT&CK patterns
Installation
npm install pipelinepulseQuick Start
Create a configuration file pipeline.yaml:
pipeline:
name: simple-deployment
maxConcurrency: 2
maxRetries: 3
stages:
- name: build
command: npm run build
- name: test
command: npm test
- name: deploy
command: npm run deploy
canary:
enabled: true
initialPercentage: 20
samplingPeriod: 30
errorThresholdPercentage: 5
metrics:
- error-rate
- response-time
metricsCommands:
error-rate: node scripts/get-error-rate.js
response-time: node scripts/get-response-time.js
deployCommands:
initial: node scripts/deploy-initial.js --percentage=20
update: node scripts/deploy-update.js
final: node scripts/deploy-final.js
rollbackCommands:
execute: node scripts/rollback.jsRun your pipeline:
npx pipelinepulse start pipeline.yamlUsage Examples
Programmatic Usage
const PipelinePulse = require('pipelinepulse');
async function deployApp() {
const pulse = new PipelinePulse({
configPath: './pipeline.yaml',
dbPath: './deployment-history.db'
});
await pulse.initialize();
const pipeline = await pulse.createPipeline({
name: 'production-deploy',
maxConcurrency: 2
});
pipeline.addStage({ name: 'build', command: 'npm run build' });
pipeline.addStage({ name: 'test', command: 'npm test' });
pipeline.addStage({ name: 'deploy', command: 'npm run deploy' });
const result = await pipeline.execute();
if (result.success) {
console.log(`Deployment completed in ${result.duration / 1000} seconds`);
} else {
console.error(`Deployment failed at stage: ${result.failedStage}`);
}
await pulse.stop();
}
deployApp().catch(console.error);Canary Deployment Example
const canary = await pulse.createCanaryDeployment({
initialPercentage: 10,
samplingPeriod: 30,
errorThreshold: 5
});
const result = await canary.deploy({
service: 'payment-service',
newVersion: '2.1.0',
deployCommands: {
initial: 'node scripts/deploy.js --version=2.1.0 --percentage=10',
update: 'node scripts/increase-traffic.js --percentage=50',
final: 'node scripts/increase-traffic.js --percentage=100'
},
rollbackCommands: {
execute: 'node scripts/rollback.js'
},
metricsCommands: {
'error-rate': 'node scripts/get-error-rate.js',
'response-time': 'node scripts/get-response-time.js'
}
});
console.log(`Canary deployment ${result.success ? 'succeeded' : 'failed'}`);CLI Commands
pipelinepulse <command> [options]Commands:
start <config-path>→ Start the PipelinePulse serverdeploy <config-path> <name>→ Execute a pipeline from configstatus <pipeline-id> [port]→ Check pipeline statushelp→ Show help
API Reference
PipelinePulse Class
const pulse = new PipelinePulse(options);
await pulse.initialize();
const pipeline = await pulse.createPipeline(config);
const canary = await pulse.createCanaryDeployment(config);
await pulse.stop();Pipeline Class
pipeline.addStage({ name, command, args, timeout });
const result = await pipeline.execute();CanaryDeployment Class
const result = await canary.deploy({
pipelineId,
service,
newVersion,
deployCommands,
rollbackCommands,
metricsCommands
});Chaos Engineering & Resilience Testing
PipelinePulse is built with resilience in mind and has been tested against various failure scenarios:
- Network Outages: Recovers automatically from temporary network failures during metric collection or command execution
- Process Termination: Maintains state even when abruptly terminated, allowing recovery on restart
- Resource Contention: Handles high concurrency with configurable limits to prevent resource exhaustion
- Metric Anomalies: Properly distinguishes between normal variation and severe issues
