# Preinstall script will build the zip upload the Lambda code to the S3 bucket
PreInstallScript: |
#!/bin/bash -xe
if [ "x{{pLambdaVersion}}" == "x" ] ; then
echo "Didn't specify pLambdaVersion on the commandline "
exit 1
fi
object="s3://{{pArtifactBucket}}/{{pArtifactPrefix}}/{{pLambdaVersion}}/{{pSlackLambdaZipFile}}"
zip="{{pSlackLambdaZipFile}}"
Lambda_Dir=../lambda
echo "Pushing new Slack Lambda to S3 bucket $object"
cd $Lambda_Dir
zip $zip slack_notify_lambda.js && aws s3 cp $zip $object && rm $zip
deploy_stack.rb -m ACCOUNTIDENTIFIER-Manifest.yaml