This service is a weekly automation that will send a team's volleyball fixture time weekly to am email.
This service uses the Serverless framework to configure/manage/deploy/test infrastructure.
See serverless.yml for all the configuration.
There is an AWS Event Cron schedule that is sent up that will invoke an AWS Lambda function. The Lambda will then scrape the volleyball fixture page and send a message to an AWS SNS topic. Any email subscription that is set up for that topic will be sent the message.
Continuous integration and continuous delivery is set up for this service using GitHub Actions.
To see configuration see ./github/workflows folder.
Currently only pushes to the main and dev branches are configure to run the pipeline.
Ensure NPM and Python is installed in your preferred way (nvm, virtual environments etc.).
Install serverless
npm install -g serverless
Set up dependencies
make setup-all
There are two scripts written for this project.
This script will print a teams fixture for the week, similar to the scheduled Lambda function.
How to run
python -m scripts.print_volleyball_team_fixture --help
This script will subscribe a provided email to a deployed stack's SNS Topic.
How to run
python -m scripts.subscribe_email_to_sns_topic --help
There are numerous tests written for this project. Unit and Integration tests are writing using pytest.
An end to end (e2e) test is written as a bash script that will use the serverless cli to invoke a lambda function
expecting to see
certain logs.
How to run pytest
pytest test
How to run e2e test
bash ./test/e2e/e2e.sh <STAGE_OF_DEPLOYMENT_TO_TEST>
Deploy a stack/stage
serverless deploy --verbose --stage <STAGE>
Invoke Lambda function
serverless invoke --function cronHandler --stage <STAGE> --log