Skip to content

Commit

Permalink
yaml file copies added into s3 prefix with CID_VERSION (#1075)
Browse files Browse the repository at this point in the history
  • Loading branch information
vtaws authored Dec 19, 2024
1 parent 4f338bf commit ead505e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion assets/build_lambda_layer.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# This script builids a lambda layer. Outpits relative path of layer zip.
# This script builds a lambda layer. Outputs relative path of layer zip.
export CID_VERSION=$(python3 -c "from cid import _version;print(_version.__version__)")
rm -rf build

Expand Down
7 changes: 6 additions & 1 deletion assets/publish_lambda_layer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

# First build layer
layer=$(./assets/build_lambda_layer.sh)
# Source the version
export CID_VERSION=$(python3 -c "from cid import _version;print(_version.__version__)")


# Then publish on s3
export AWS_REGION=us-east-1
Expand All @@ -23,7 +26,7 @@ aws cloudformation list-stack-instances \
if [ $? -ne 0 ]; then
echo "Error: $output"
else
echo "Uploaded successfuly"
echo "Uploaded successfully"
fi
done

Expand All @@ -35,6 +38,8 @@ rm -vf ./$layer
if aws s3 ls "s3://aws-managed-cost-intelligence-dashboards" >/dev/null 2>&1; then
echo "Updating cid-cfn.yml"
aws s3 sync ./cfn-templates/ s3://aws-managed-cost-intelligence-dashboards/cfn/
# Publish additional copy into respective version folder
aws s3 sync ./cfn-templates/ "s3://aws-managed-cost-intelligence-dashboards/cfn/${CID_VERSION}/"

echo "Syncing dashboards"
aws s3 sync ./dashboards s3://aws-managed-cost-intelligence-dashboards/hub/
Expand Down

0 comments on commit ead505e

Please sign in to comment.