Skip to content

Commit

Permalink
Add deploy to CircleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
lbeaufort committed Feb 2, 2022
1 parent 0f51b0c commit 1d46abc
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 2 deletions.
25 changes: 25 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,30 @@ jobs:
command: python manage.py test --keep
working_directory: ~/project/django-backend/

deploy:

docker:
- image: cimg/python:3.7

steps:
- checkout

- python/install-packages:
pkg-manager: pip
pip-dependency-file: requirements.txt

- run:
name: Installs for deploy
command: |
mkdir -p $HOME/bin
export PATH=$HOME/bin:$PATH
curl -L "https://cli.run.pivotal.io/stable?release=linux64-binary&version=7.1.0" | tar xzv -C $HOME/bin
- deploy:
name: Deploy API
command: |
export PATH=$HOME/bin:$PATH
invoke deploy --branch $CIRCLE_BRANCH --login True
# Invoke jobs via workflows
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
Expand All @@ -105,5 +129,6 @@ workflows:
jobs:
- unit-test
- lint
- deploy


1 change: 0 additions & 1 deletion bin/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ cd django-backend
./manage.py migrate --noinput

# Run application
# python wait_for_db.py &&
gunicorn --bind 0.0.0.0:8080 fecfiler.wsgi -w 10 -t 200 --reload
14 changes: 14 additions & 0 deletions manifest-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
applications:
- name: fecfile-web-api
routes:
- route: fecfile-web-api-prod.app.cloud.gov
stack: cflinuxfs3
buildpacks:
- python_buildpack
memory: 512M
services:
- fecfile-api-rds
env:
DISABLE_COLLECTSTATIC: 1
# DJANGO_SETTINGS_MODULE: django-backend.fecfiler.settings.production
14 changes: 14 additions & 0 deletions manifest-stage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
applications:
- name: fecfile-web-api
routes:
- route: fecfile-web-api-stage.app.cloud.gov
stack: cflinuxfs3
buildpacks:
- python_buildpack
memory: 512M
services:
- fecfile-api-rds
env:
DISABLE_COLLECTSTATIC: 1
# DJANGO_SETTINGS_MODULE: django-backend.fecfiler.settings.production
3 changes: 2 additions & 1 deletion tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ def _detect_space(repo, branch=None):
DEPLOY_RULES = (
('prod', _detect_prod),
('stage', lambda _, branch: branch.startswith('release')),
('dev', lambda _, branch: branch == 'develop'),
#('dev', lambda _, branch: branch == 'develop'),
('dev', lambda _, branch: branch == 'feature/40-test-cloud-gov'),
)


Expand Down

0 comments on commit 1d46abc

Please sign in to comment.