#!/bin/bash

export DEPLOYMENT_DIR='slackSbump-lambda-deployment'
export PACKAGE_NAME='slackSbumpLambdaFunction.zip'
mkdir $DEPLOYMENT_DIR
cp ./lambda_function.py $DEPLOYMENT_DIR
cp ./store.py $DEPLOYMENT_DIR
cp ./sqs.py $DEPLOYMENT_DIR
pip install -r requirements.txt -t $DEPLOYMENT_DIR
cd $DEPLOYMENT_DIR
zip -r ${OLDPWD}/$PACKAGE_NAME *
cd $OLDPWD
rm -r $DEPLOYMENT_DIR

echo "*******************************************************"
echo "*******************************************************"
echo "To deploy the generated zip package (slackSbumpLambdaFunction.zip) as the new lambda function execute:"
echo "aws lambda update-function-code --function-name slackSbump --zip-file fileb://slackSbumpLambdaFunction.zip"
