Skip to content

Commit

Permalink
pipeline debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
rrigato committed Jul 21, 2024
1 parent 5d5baf4 commit 125b5ef
Showing 1 changed file with 25 additions and 36 deletions.
61 changes: 25 additions & 36 deletions scripts/burnday_build_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,63 +7,52 @@ export BUCKET_NAME="${PROJECT_NAME}-app-artifacts"
export DEPLOYMENT_PACKAGE="${PROJECT_NAME}_deployment_package.zip"


# python -m venv avenv
python -m venv avenv

# source avenv/bin/activate
# pip install -r requirements/requirements-dev.txt
source avenv/bin/activate
pip install -r requirements/requirements-dev.txt

# secret_scan_results=$(detect-secrets scan | \
# python3 -c "import sys, json; print(json.load(sys.stdin)['results'])" )
secret_scan_results=$(detect-secrets scan | \
python3 -c "import sys, json; print(json.load(sys.stdin)['results'])" )

# # static scan for security credentials that terminates if any secrets are found
# if [ "${secret_scan_results}" != "{}" ]; then
# echo "detect-secrets scan failed"
# exit 125
# fi
# static scan for security credentials that terminates if any secrets are found
if [ "${secret_scan_results}" != "{}" ]; then
echo "detect-secrets scan failed"
exit 125
fi


# python -m unittest
python -m unittest

# deactivate
deactivate

echo "--------beginning bundle--------"

echo $DEPLOYMENT_PACKAGE \
$PROJECT_NAME

zip $DEPLOYMENT_PACKAGE -r $PROJECT_NAME \
-x *__pycache__* --quiet

echo "zip command 2"

zip -u $DEPLOYMENT_PACKAGE -j handlers/${PROJECT_NAME}_skill.py \
-x *__pycache__* --quiet

echo "zip command 3"

echo $DEPLOYMENT_PACKAGE

ls -l externals

zip -v external_test -j externals \
-x *__pycache__*
zip -u $DEPLOYMENT_PACKAGE externals \
-x *__pycache__* --quiet

echo "--------deployment package created--------"


# aws s3api put-object --bucket $BUCKET_NAME \
# --region $REGION_NAME \
# --key $PROJECT_NAME/$DEPLOYMENT_PACKAGE \
# --body $DEPLOYMENT_PACKAGE \
# --tagging "cloudformation=no&project=${PROJECT_NAME}&keep=yes"
aws s3api put-object --bucket $BUCKET_NAME \
--region $REGION_NAME \
--key $PROJECT_NAME/$DEPLOYMENT_PACKAGE \
--body $DEPLOYMENT_PACKAGE \
--tagging "cloudformation=no&project=${PROJECT_NAME}&keep=yes"




# aws lambda update-function-code \
# --region $REGION_NAME \
# --function-name "${PROJECT_NAME}-alexa-skill" \
# --s3-bucket $BUCKET_NAME \
# --s3-key $PROJECT_NAME/$DEPLOYMENT_PACKAGE \
# --no-cli-pager
aws lambda update-function-code \
--region $REGION_NAME \
--function-name "${PROJECT_NAME}-alexa-skill" \
--s3-bucket $BUCKET_NAME \
--s3-key $PROJECT_NAME/$DEPLOYMENT_PACKAGE \
--no-cli-pager

0 comments on commit 125b5ef

Please sign in to comment.