Last active
April 12, 2018 17:31
-
-
Save keegandonley/2da8b2e1c5a94d5da87fac3df88ed0fa to your computer and use it in GitHub Desktop.
Auto-deploy to lambda
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { exec } = require('child_process'); | |
const functions = [ | |
'createSession', | |
'getGeneralResources', | |
'getFireResources', | |
'getMeaning', | |
'receiveMeaning', | |
'getHousingResources', | |
'receiveEmail', | |
'getResources', | |
'getMembers', | |
'updateSession', | |
]; | |
functions.forEach((lambdaFunc) => { | |
const command = `cd ./scripts/lambda && zip ${lambdaFunc}.zip ${lambdaFunc}.js && aws lambda update-function-code --function-name ${lambdaFunc} --zip-file fileb://${lambdaFunc}.zip`; | |
const deploy = exec(command); | |
deploy.stdout.on('data', (data) => { | |
console.log(`deploy-cloud: ${data}`); | |
}); | |
deploy.stderr.on('data', (data) => { | |
console.log(`deploy-cloud-err: ${data}`); | |
}); | |
deploy.on('close', (code) => { | |
console.log(`deploy to cloud exited with code ${code}`); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment