Skip to content

Commit

Permalink
Fix stage deploy
Browse files Browse the repository at this point in the history
- temp add branch
- pip install aws-sam-cli from requirements file
  • Loading branch information
VirginiaDooley committed Sep 19, 2024
1 parent 38b2f6c commit d6c2891
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
17 changes: 10 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
version: 2.1

orbs:
python: circleci/python@0.2.1
python: circleci/python@2.1.1
jobs:
install_and_update_dependencies:
docker:
- image: circleci/python:3.8.6-node
- image: cimg/python:3.8.6-node
working_directory: ~/repo
steps:
- checkout
Expand All @@ -28,11 +27,11 @@ jobs:
when: on_success
paths:
- ~/.local/share/virtualenvs/
key: v2-dependencies-{{ checksum "Pipfile.lock" }}-{{ checksum "thumbs/Pipfile.lock" }}
key: v3-dependencies-{{ checksum "Pipfile.lock" }}-{{ checksum "thumbs/Pipfile.lock" }}

run-tests:
docker:
- image: circleci/python:3.8.6
- image: cimg/python:3.8.6
working_directory: ~/repo
steps:
- checkout
Expand Down Expand Up @@ -72,19 +71,22 @@ jobs:
- attach_workspace:
at: ~/repo/
- run: pip install --upgrade pip
- run: pip install -r deploy-requirements.txt
- run: pip install -r lambda-layers/DependenciesLayer/requirements.txt
- run: make collectstatic
- run: sam build ${DASH_DASH_DEBUG}
- run: python manage.py collectstatic --noinput --clear

- persist_to_workspace:
root: ~/repo/
paths:
- .aws-sam/build/
- thumbs/.aws-sam/build/
- lambda-layers/DependenciesLayer/requirements.txt

sam_deploy:
docker:
- image: circleci/python:3.8.6
- image: cimg/python:3.8.6
working_directory: ~/repo/
parameters:
dc-environment:
Expand Down Expand Up @@ -139,6 +141,7 @@ jobs:
AppDomain='$PUBLIC_FQDN' \
AppLeafletImagesBucketName='$LEAFLET_IMAGES_BUCKET_NAME' \
"
- run: pipenv run makemigrations
- run: pipenv run migratedb
- run: pipenv run createcachetable
- run: printenv LEAFLET_IMAGES_BUCKET_NAME
Expand Down Expand Up @@ -214,7 +217,7 @@ workflows:
- run-tests # staging should only deploy if tests pass
- sam_build # deploy needs .aws-sam/build/
context: [ deployment-staging-election-leaflets ]
filters: { branches: { only: [ master ] } }
filters: { branches: { only: [ master, staticfiles-on-stage ] } }

- sam_deploy:
name: sam_deploy_production
Expand Down
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,6 @@ collectstatic = "python manage.py collectstatic -c --noinput"
createcachetable = "python manage.py createcachetable"
pytest = "pytest"
coveralls = "coveralls"
makemigrations = "python manage.py makemigrations"
migratedb = "python manage.py migrate --noinput"
thumbs_sam_build = "bash -c 'cd thumbs && sam build'"
1 change: 1 addition & 0 deletions deploy-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
aws-sam-cli==1.115.0

0 comments on commit d6c2891

Please sign in to comment.