-
Notifications
You must be signed in to change notification settings - Fork 20
More Circle CI testing #518
Changes from 29 commits
ae107f2
3f76eb6
ce3b273
de7be82
4af906a
95a3e1b
6805e72
8d9cc61
0a188db
8e19ee5
250d4e4
dd83e26
38e3273
d99da7c
62c130c
3826b17
ef57502
0c7ae15
4cbabff
ef8ae7e
792480e
aeef173
da520c6
be07e53
142e616
ccd553d
ef200ae
4885944
16a3eb7
733ca11
e6c3f66
d9c0d7b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Python CircleCI 2.0 configuration file | ||
# | ||
# Check https://circleci.com/docs/2.0/language-python/ for more details | ||
# | ||
version: 2 | ||
jobs: | ||
build: | ||
docker: | ||
- image: circleci/python:3.6.2 | ||
|
||
# Specify service dependencies here if necessary | ||
# CircleCI maintains a library of pre-built images | ||
# documented at https://circleci.com/docs/2.0/circleci-images/ | ||
# - image: circleci/postgres:9.4 | ||
|
||
working_directory: ~/repo | ||
|
||
steps: | ||
- checkout | ||
- setup_remote_docker | ||
|
||
# Download and cache dependencies | ||
- restore_cache: | ||
keys: | ||
- v1-dependencies-{{ checksum "requirements.txt" }} | ||
# fallback to using the latest cache if no exact match is found | ||
- v1-dependencies- | ||
|
||
- save_cache: | ||
paths: | ||
- ./venv | ||
key: v1-dependencies-{{ checksum "requirements.txt" }} | ||
|
||
# setup | ||
- run: | ||
name: circleci-setup | ||
command: | | ||
docker create -v /usr/src/app -v /usr/src/app/.venv --name holder python:3.6.2 | ||
docker cp . holder:/usr/src/app | ||
docker start holder | ||
# run tests! | ||
- run: | ||
name: run tests | ||
command: | | ||
ls eregs_libs | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this still needed? |
||
docker-compose -f docker-compose-circle.yml run flake8 atf_eregs | ||
docker-compose -f docker-compose-circle.yml run py.test atf_eregs/tests | ||
environment: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not needed this time through, but we should figure out how to run the parser tests, too. |
||
DEBUG: TRUE | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this needed? I think the docker-compose file is setting the |
||
|
||
- store_artifacts: | ||
path: test-reports | ||
destination: test-reports | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,14 +13,14 @@ if [ -n "$DEBUG" ]; then | |
|
||
if git diff --exit-code eregs_libs/regulations-site > /dev/null | ||
then | ||
git submodule update eregs_libs/regulations-site | ||
git submodule update --init eregs_libs/regulations-site | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
else | ||
echo "Warning: Modified version of regulations-site detected" | ||
fi | ||
|
||
if git diff --exit-code eregs_libs/regulations-core > /dev/null | ||
then | ||
git submodule update eregs_libs/regulations-core | ||
git submodule update --init eregs_libs/regulations-core | ||
else | ||
echo "Warning: Modified version of regulations-core detected" | ||
fi | ||
|
@@ -33,5 +33,4 @@ else | |
pip-sync requirements.txt | ||
fi | ||
|
||
|
||
exec "$@" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
version: '2' | ||
services: | ||
persistent_db: | ||
image: postgres:9.4 | ||
volumes_from: | ||
- container:holder | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not for this round, but if the volumes are the only significant change, what do you think about replacing them in a |
||
prod: &PROD | ||
image: python:3.6.2 | ||
command: ./devops/activate_then ./devops/run_webserver.sh | ||
ports: | ||
- 9000:9000 | ||
environment: &PROD_ENV | ||
PORT: 9000 | ||
DJANGO_SETTINGS_MODULE: atf_eregs.settings.base | ||
TMPDIR: /tmp | ||
STATIC_ROOT: frontend_build | ||
VCAP_APPLICATION: > | ||
{"uris": ["localhost", "0.0.0.0", "127.0.0.1"]} | ||
volumes_from: | ||
- container:holder | ||
working_dir: /usr/src/app | ||
stdin_open: true | ||
tty: true | ||
dev: &DEV | ||
<<: *PROD | ||
ports: | ||
- 8000:8000 | ||
environment: &DEV_ENV | ||
<<: *PROD_ENV | ||
DEBUG: "true" | ||
PORT: 8000 | ||
dev-with-db: | ||
<<: *DEV | ||
ports: | ||
- 8001:8001 | ||
command: ./devops/wait_for_db_then ./devops/activate_then ./devops/run_webserver.sh | ||
environment: | ||
<<: *DEV_ENV | ||
DATABASE_URL: postgres://postgres@persistent_db/postgres | ||
PORT: 8001 | ||
VCAP_APPLICATION: > | ||
{"uris": ["localhost", "0.0.0.0", "127.0.0.1", "dev-with-db"]} | ||
depends_on: | ||
- persistent_db | ||
|
||
|
||
#---- Commands ---- | ||
manage.py: | ||
<<: *DEV | ||
entrypoint: ./devops/activate_then ./manage.py | ||
command: '' | ||
ports: [] | ||
|
||
py.test: | ||
<<: *DEV | ||
entrypoint: ./devops/activate_then py.test | ||
command: '' | ||
ports: [] | ||
|
||
flake8: | ||
<<: *DEV | ||
entrypoint: ./devops/activate_then flake8 | ||
command: '' | ||
ports: [] | ||
|
||
pip-compile: | ||
<<: *DEV | ||
entrypoint: ./devops/activate_then pip-compile | ||
command: '' | ||
ports: [] | ||
|
||
bandit: | ||
<<: *DEV | ||
entrypoint: ./devops/activate_then bandit | ||
command: '' | ||
ports: [] | ||
|
||
grunt: | ||
image: node:6 | ||
volumes: | ||
- $PWD:/usr/src/app | ||
- npm_libs:/usr/src/app/frontend_build/node_modules/ | ||
working_dir: /usr/src/app/frontend_build/ | ||
entrypoint: ../devops/deps_ok_then ./node_modules/.bin/grunt | ||
|
||
volumes: | ||
database_data: | ||
prod_libs: | ||
dev_libs: | ||
npm_libs: |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,6 +55,12 @@ services: | |
command: '' | ||
ports: [] | ||
|
||
orient: | ||
<<: *DEV | ||
entrypoint: ls | ||
command: '' | ||
ports: [] | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm betting this addition wasn't intended? |
||
py.test: | ||
<<: *DEV | ||
entrypoint: ./devops/activate_then py.test | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very innovative solution, nice work!