UNPKG

automated-deployment-aws

Version:

Library that automates the deployment of the current project into aws machine

30 lines (21 loc) 877 B
const { exec } = require("child_process"); const chalk = require('chalk') const executeUploadingInAWS = (config) => { const command = "scp -i "+ config.pemKeyPath+ " " + config.zipFilePath+".zip" + " " + config.userName + "@" + config.awsIP + ":./" + config.awsFilePath //console.log("command ="+ command ); exec(command, (error, stdout, stderr) => { if (error) { console.log(chalk.red(`Failed to Deploy the application ${error.message}`)) return; } if (stderr) { console.log(chalk.red(`Failed to Deploy the application : ${stderr}`)) return; } console.log(chalk.green.inverse("Successfully deployed the project on to the specified aws machine")) //console.log(`stdout: ${stdout}`); }); } module.exports = { executeUploadingInAWS : executeUploadingInAWS }