File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # This script can be used for release or testing of lambda layers upload.
13export CID_VERSION=$( python3 -c " from cid import _version;print(_version.__version__)" )
4+ rm -rf build
25
6+ echo ' Building a layer'
37mkdir -p ./python
48pip3 install . -t ./python
59zip -qr cid-$CID_VERSION .zip ./python
6- ls cid-$CID_VERSION .zip
10+ ls -l cid-$CID_VERSION .zip
711rm -rf ./python
812
913export AWS_REGION=us-east-1
@@ -29,5 +33,20 @@ aws cloudformation list-stack-instances \
2933 fi
3034 done
3135
32- echo ' cleanup '
36+ echo ' Cleanup '
3337rm -vf ./cid-$CID_VERSION .zip
38+
39+
40+ # Publish cfn (only works for the release)
41+ aws s3 ls aws-managed-cost-intelligence-dashboards
42+ if [ $? -eq 0 ]; then
43+ echo " Updating cid-cfn.yml"
44+ aws s3api put-object \
45+ --bucket " aws-managed-cost-intelligence-dashboards" \
46+ --key cfn/cid-cfn.yml \
47+ --body ./cfn-templates/cid-cfn.yml
48+ else
49+ echo " Not a main account. Skipping update of cid-cfn.yml"
50+ fi
51+
52+ echo ' Done'
You can’t perform that action at this time.
0 commit comments