Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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}`);
- });
- });
Add Comment
Please, Sign In to add comment