cfn-forge
Version:
CloudFormation deployment automation tool with git-based workflows
133 lines (118 loc) • 3.35 kB
JavaScript
/**
* Deployment Engine Interface
* Defines the contract for deployment orchestration to ensure portability
*/
class IDeploymentEngine {
/**
* Initialize the deployment engine
* @param {Object} config - Configuration object
* @returns {Promise<void>}
*/
async initialize(config) {
throw new Error('Not implemented');
}
/**
* Execute a deployment
* @param {Object} options - Deployment options
* @param {string} options.environment - Target environment
* @param {string} options.stackName - Stack name
* @param {string} options.templatePath - Path to template
* @param {Object} options.parameters - Stack parameters
* @param {boolean} options.dryRun - Dry run mode
* @returns {Promise<Object>} Deployment result
*/
async deploy(options) {
throw new Error('Not implemented');
}
/**
* Start watching for deployment triggers
* @param {Object} options - Watch options
* @returns {Promise<void>}
*/
async startWatching(options) {
throw new Error('Not implemented');
}
/**
* Stop watching for deployment triggers
* @returns {Promise<void>}
*/
async stopWatching() {
throw new Error('Not implemented');
}
/**
* Validate deployment readiness
* @param {Object} options - Validation options
* @returns {Promise<Object>} Validation result
*/
async validateDeployment(options) {
throw new Error('Not implemented');
}
/**
* Get deployment history
* @param {string} stackName - Stack name
* @param {Object} options - Query options
* @returns {Promise<Array>} Deployment history
*/
async getDeploymentHistory(stackName, options = {}) {
throw new Error('Not implemented');
}
/**
* Rollback to previous deployment
* @param {string} stackName - Stack name
* @param {string} targetVersion - Target version to rollback to
* @returns {Promise<Object>} Rollback result
*/
async rollback(stackName, targetVersion) {
throw new Error('Not implemented');
}
/**
* Get current deployment state
* @param {string} stackName - Stack name
* @returns {Promise<Object>} Current state
*/
async getDeploymentState(stackName) {
throw new Error('Not implemented');
}
/**
* Save deployment state
* @param {string} stackName - Stack name
* @param {Object} state - State to save
* @returns {Promise<void>}
*/
async saveDeploymentState(stackName, state) {
throw new Error('Not implemented');
}
/**
* Check if deployment is needed
* @param {Object} options - Check options
* @returns {Promise<boolean>} True if deployment needed
*/
async shouldDeploy(options) {
throw new Error('Not implemented');
}
/**
* Register deployment event handler
* @param {string} event - Event name
* @param {Function} handler - Event handler
* @returns {void}
*/
on(event, handler) {
throw new Error('Not implemented');
}
/**
* Get deployment configuration
* @returns {Object} Current configuration
*/
getConfiguration() {
throw new Error('Not implemented');
}
/**
* Update deployment configuration
* @param {Object} config - New configuration
* @returns {Promise<void>}
*/
async updateConfiguration(config) {
throw new Error('Not implemented');
}
}
module.exports = IDeploymentEngine;