Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 17 additions & 18 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ orbs:
jobs:
install_and_update_dependencies:
docker:
- image: cimg/python:3.8.12-browsers
- image: cimg/python:3.10-browsers
working_directory: ~/repo
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "Pipfile.lock" }}
- v2-dependencies-{{ checksum "Pipfile.lock" }}
- run: &install-pipenv pip install -U pipenv pip --quiet --no-input
- run: pipenv install --dev
- run: pipenv run pipenv check # before save_cache so an insecure cache is never saved
Expand All @@ -25,11 +25,11 @@ jobs:
when: on_success
paths:
- ~/.local/share/virtualenvs/
key: v1-dependencies-{{ checksum "Pipfile.lock" }}
key: v2-dependencies-{{ checksum "Pipfile.lock" }}

test:
docker:
- image: cimg/python:3.8.12
- image: cimg/python:3.10
environment:
CIRCLECI: true
PGHOST: 127.0.0.1
Expand All @@ -40,7 +40,7 @@ jobs:
# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "Pipfile.lock" }}
- v2-dependencies-{{ checksum "Pipfile.lock" }}
- run: *install-pipenv
- run:
name: Install Playwright-deps
Expand All @@ -60,23 +60,22 @@ jobs:

sam_build:
docker:
- image: amazon/aws-sam-cli-build-image-python3.8:latest
- image: public.ecr.aws/sam/build-python3.10:latest
working_directory: ~/repo
steps:
- checkout
- attach_workspace:
at: ~/repo/
- run: pip install --upgrade pip
- run: pip install aws-sam-cli==1.71.0
- run: pip install -r postcode_lookup/requirements.txt
# - run: pip install --upgrade pip
# - run: pip install -r postcode_lookup/requirements.txt
- run: sam build ${DASH_DASH_DEBUG} --template-file template.yaml
- persist_to_workspace:
root: ~/repo/
paths: [ .aws-sam/build/ ]

sam_deploy:
docker:
- image: cimg/python:3.8.12
- image: cimg/python:3.10
working_directory: ~/repo/
parameters:
dc-environment:
Expand All @@ -94,7 +93,7 @@ jobs:
keys:
- v2-dependencies-{{ checksum "Pipfile.lock" }}
- run: *install-pipenv
- run: pip install aws-sam-cli==1.71.0
- run: pip install aws-sam-cli

- run:
name: "pipenv run sam deploy"
Expand All @@ -115,7 +114,7 @@ jobs:

static_deploy:
docker:
- image: cimg/python:3.8.12
- image: cimg/python:3.10
working_directory: ~/repo/
parameters:
dc-environment:
Expand All @@ -126,7 +125,7 @@ jobs:
# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "Pipfile.lock" }}
- v2-dependencies-{{ checksum "Pipfile.lock" }}
- run: *install-pipenv
- aws-cli/setup
- run:
Expand All @@ -152,7 +151,7 @@ jobs:

smoke_test:
docker:
- image: cimg/python:3.8.12
- image: cimg/python:3.10
working_directory: ~/repo/
parameters:
dc-environment:
Expand All @@ -163,7 +162,7 @@ jobs:
# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "Pipfile.lock" }}
- v2-dependencies-{{ checksum "Pipfile.lock" }}
- run: *install-pipenv
- aws-cli/setup
- run:
Expand All @@ -190,21 +189,21 @@ workflows:
requires:
- sam_build
context: [ deployment-development-ec-postcode-lookup ]
filters: { branches: { only: [ main, master ] } }
filters: { branches: { only: [ main, master, add-new-urls ] } }
- static_deploy:
name: static_deploy_development
dc-environment: development
requires:
- sam_deploy_development
context: [ deployment-development-ec-postcode-lookup ]
filters: { branches: { only: [ main, master ] } }
filters: { branches: { only: [ main, master, add-new-urls ] } }
- smoke_test:
name: smoke_test_development
dc-environment: development
requires:
- static_deploy_development
context: [ deployment-development-ec-postcode-lookup ]
filters: { branches: { only: [ main, master ] } }
filters: { branches: { only: [ main, master, add-new-urls ] } }


- sam_deploy:
Expand Down
6 changes: 5 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: debug-statements
- id: trailing-whitespace
Expand All @@ -18,3 +17,8 @@ repos:
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix, --extend-exclude, TCH]
- repo: https://github.com/awslabs/cfn-python-lint
rev: v0.83.3 # The version of cfn-lint to use
hooks:
- id: cfn-python-lint
files: template.yaml$
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.8.12
3.10
4 changes: 2 additions & 2 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ verify_ssl = true
name = "pypi"

[packages]
starlette = {extras = ["jinja2"], version = "0.28.0"}
starlette = {extras = ["jinja2"], version = "==0.28.0"}
jinja2 = "3.1.2"
mangum = "==0.15.0"
httpx = "0.23.1"
Expand Down Expand Up @@ -32,7 +32,7 @@ pytest-playwright = "*"
pre-commit = "*"

[requires]
python_version = "3.8"
python_version = "3.10"

[scripts]
black = "black ."
Expand Down
Loading