Skip to content

Latest commit

 

History

History
72 lines (63 loc) · 1.61 KB

README.md

File metadata and controls

72 lines (63 loc) · 1.61 KB

deep-util-services CI

Services for DEEP Utilities that run in serverless framework.

Project structure

.
├── package.json
├── package-lock.json
├── README.md
├── requirements.txt
├── scripts
│   └── <helper script>
├── secrets
│   └── <stage>.json
├── serverless.yml
└── src
    ├── authorizer
    ├── common
    │   └── <shared code>
    ├── functions
    │   └── <function1>

Requirements Install

# Install serverless dependencies
yarn install

# Install python requirements
mkdir .python-venv
./scripts/requirements-install.sh

Envionment configuration

The configuration are stored in secrets directory. Copy secrets/sample.json to secrets/<stage>.json and provide the required value.

Offline

Lambda server

# Start local lambda server
# TODO: hot reload not working
PYTHONPATH=.python-venv npx sls offline

Unit tests

# Create virtual-venv
python3 -m venv .python-venv
# Activate venv
source .python-venv/bin/activate
# Install packages
pip install -r requirements.txt
# Create/Copy env
cp .env.testing.sample .env
# Read test env and run test
source .env && ./.python-venv/bin/pytest -vv --last-failed

Deploying

Add AWS account to your ~/.aws/credentials

[deep-serverless]
region = us-east-1
aws_access_key_id = XXXXXXXXXXXXXXXXXXXX
aws_secret_access_key = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

For deploying local stage

AWS_PROFILE=deep-serverless npx sls deploy --stage local