-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
126 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Lambda | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
package: | ||
name: Python Package | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
package: | ||
- mailer | ||
|
||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.11 | ||
cache: pip | ||
cache-dependency-path: | | ||
**/pyproject.toml | ||
**/requirements*.txt | ||
- name: Prepare Python env | ||
run: | | ||
python -m pip install -U pip setuptools wheel | ||
- name: Create build info | ||
run: | | ||
bash scripts/build-info.sh | ||
- name: Install dependencies | ||
run: | | ||
cd packages/dsw-${{ matrix.package }} | ||
make build-lambda-package | ||
- name: Create artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ matrix.package }}-lambda.zip | ||
path: packages/dsw-${{ matrix.package }}/${{ matrix.package }}-lambda.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
from .cli import main | ||
from .lambda_handler import lambda_handler | ||
|
||
__all__ = ['main'] | ||
__all__ = ['main', 'lambda_handler'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import pathlib | ||
|
||
from dsw.mailer.cli import validate_config | ||
from dsw.mailer.mailer import Mailer | ||
|
||
|
||
def lambda_handler(event, context): | ||
with open("/var/task/application.yml", "r") as config_file: | ||
config = validate_config(None, None, config_file) | ||
config.log.apply() | ||
mailer = Mailer(config, pathlib.Path("/var/task/templates")) | ||
mailer.run_once() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters