From a66a00c5889956e789edfbcb5579a13d12576f87 Mon Sep 17 00:00:00 2001 From: Akash A Date: Tue, 14 Mar 2017 09:42:24 +0000 Subject: [PATCH] add support for multiple stacks pushing to custom channels --- cf-notify.json | 8 ++------ deploy.sh | 19 +++++++++++-------- lambda_notify.py | 15 +++++++++++++-- 3 files changed, 26 insertions(+), 16 deletions(-) diff --git a/cf-notify.json b/cf-notify.json index b467383..d835931 100644 --- a/cf-notify.json +++ b/cf-notify.json @@ -3,11 +3,7 @@ "Description": "cf notify stack", "Parameters": { "Bucket": { - "Description": "S3 bucket to locate lambda function (cf-notify-$CHANNEL.zip)", - "Type": "String" - }, - "Channel": { - "Description": "Slack channel name", + "Description": "S3 bucket to locate lambda function (cf-notify.zip)", "Type": "String" } }, @@ -77,7 +73,7 @@ }, "Code": { "S3Bucket": { "Ref": "Bucket" }, - "S3Key": { "Fn::Join": [ "", [ "cf-notify-", { "Ref": "Channel" }, ".zip" ] ] } + "S3Key": "cf-notify.zip" }, "Runtime": "python2.7", "Timeout": "30" diff --git a/deploy.sh b/deploy.sh index 4440aa1..6aa808e 100755 --- a/deploy.sh +++ b/deploy.sh @@ -49,35 +49,38 @@ fi CHANNEL_NAME=`echo ${CHANNEL:1} | tr '[:upper:]' '[:lower:]'` echo 'Creating bucket' -BUCKET="cf-notify-$CHANNEL_NAME-`pwgen -1 --no-capitalize 5`" +BUCKET="cf-notify-`pwgen -1 --no-capitalize 5`" echo $BUCKET aws s3 mb "s3://$BUCKET" --profile $PROFILE echo "Bucket $BUCKET created" echo 'Creating lambda zip artifact' -cat > slack.py < slack.py <