-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2154 from fedspendingtransparency/staging
Sprint 95 Production Deploy
- Loading branch information
Showing
129 changed files
with
1,676 additions
and
2,869 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ language: python | |
cache: pip | ||
|
||
python: | ||
- '3.5' | ||
- '3.7' | ||
|
||
services: | ||
|
@@ -41,7 +40,7 @@ before_install: | |
- npm install [email protected] --global | ||
|
||
install: | ||
- if [[ $TRAVIS_PYTHON_VERSION == '3.7' ]]; then travis_retry pip install -r requirements/requirements_3-7.txt; else travis_retry pip install -r requirements/requirements.txt; fi | ||
- travis_retry pip install -r requirements/requirements.txt | ||
- pip install coveralls | ||
# Checkout dependent broker code used to spin up a broker integration test db. Put it in its own folder alongside this repo's code | ||
- echo "Using ${BROKER_REPO_BRANCH} branch from ${BROKER_REPO_URL}" | ||
|
@@ -73,7 +72,7 @@ before_script: | |
script: | ||
- cd ${TRAVIS_BUILD_DIR} # run build script out of repo dir | ||
- flake8 | ||
- if [[ $TRAVIS_PYTHON_VERSION == '3.7' ]]; then black --check --diff . ; fi | ||
- black --check --diff . | ||
- python manage.py check_for_endpoint_documentation | ||
- pytest --ignore-glob='**/tests/integration/*' --cov=usaspending_api --cov-report= --reuse-db -rsx | ||
- pytest --override-ini=python_files='**/tests/integration/test_*.py **/tests/integration/*_test.py' --cov=usaspending_api --cov-append --cov-report term --cov-report xml:coverage.xml --reuse-db -rsx | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,47 @@ | ||
# Basic Dockerfile for the USASpendingAPI | ||
|
||
## 0) Add your DATABASE_URL on the ENV line below. Use host.docker.internal instead of localhost (overidden with Docker compose) | ||
## | ||
## 1) Init/run order w/Docker compose: | ||
## docker-compose up usaspending-db (leave running) | ||
## docker-compose up usaspending-db-migrate | ||
## docker-compose up usaspending-db-sql | ||
## docker-compose up usaspending-db-init | ||
## docker-compose up usaspending-es (leave running, elasticsearch) | ||
## Then run/re-run using the db you just created (may need to wait for the DB to be up and listening): | ||
## docker-compose up usaspending-api | ||
## | ||
## Add your DATABASE_URL on the ENV line below. Use host.docker.internal instead of localhost (overidden with Docker compose) | ||
|
||
## Optional) Run ad-hoc commands: | ||
# docker build . -t usaspendingapi | ||
# docker run -p 127.0.0.1:8000:8000 usaspendingapi <command> | ||
|
||
# Rebuild and run when code in /usaspending-api changes | ||
|
||
FROM python:3.5 | ||
|
||
WORKDIR /dockermount | ||
|
||
# For "Wrong sources.list entry or malformed file" re: main/binary-amd64/Packages, revisit | ||
RUN printf "deb http://archive.debian.org/debian/ jessie main\ndeb-src http://archive.debian.org/debian/ jessie main\ndeb http://security.debian.org jessie/updates main\ndeb-src http://security.debian.org jessie/updates main" > /etc/apt/sources.list | ||
# See README.md for docker-compose information | ||
|
||
# Install postgres client to access psql for database downloads | ||
RUN printf "deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main" > /etc/apt/sources.list.d/pgdg.list | ||
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - | ||
RUN apt-get update && apt-get install -y postgresql-client-10 | ||
FROM centos:7 | ||
|
||
RUN apt-get update -y | ||
WORKDIR /dockermount | ||
|
||
COPY requirements/requirements.txt /dockermount/requirements/requirements.txt | ||
RUN pip install -r requirements/requirements.txt | ||
RUN yum -y update && yum clean all | ||
RUN yum -y install wget gcc openssl-devel bzip2-devel libffi libffi-devel zlib-devel | ||
RUN yum -y groupinstall "Development Tools" | ||
|
||
##### Install PostgreSQL 10 client (psql) | ||
RUN yum -y install https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-redhat10-10-2.noarch.rpm | ||
RUN yum -y install postgresql10 | ||
|
||
##### Building python 3.7 | ||
WORKDIR /usr/src | ||
RUN wget --quiet https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tgz | ||
RUN tar xzf Python-3.7.3.tgz | ||
WORKDIR /usr/src/Python-3.7.3 | ||
RUN ./configure --enable-optimizations | ||
RUN make altinstall | ||
RUN ln -sf /usr/local/bin/python3.7 /usr/bin/python3 | ||
RUN echo "$(python3 --version)" | ||
|
||
##### Copy python packaged | ||
WORKDIR /dockermount | ||
COPY requirements/ /dockermount/requirements/ | ||
RUN python3 -m pip install -r requirements/requirements.txt | ||
|
||
##### Copy the rest of the project files into the container | ||
COPY . /dockermount | ||
|
||
# Compose overrides DATABASE_URL | ||
##### Compose overrides DATABASE_URL | ||
ENV DATABASE_URL postgres://[email protected]:5432/data_store_api | ||
|
||
ENV PYTHONUNBUFFERED=0 | ||
|
||
EXPOSE 8000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1 @@ | ||
django-elasticache==1.0.2 | ||
django-redis==4.8.0 | ||
pylibmc==1.5.2 | ||
pyparsing==2.2.0 | ||
packaging==16.8 | ||
-r requirements-server.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
black==19.10b0 | ||
coverage==4.5.4 | ||
docker==4.1.0 | ||
dredd-hooks==0.2.0 | ||
flake8==3.7.8 | ||
git+https://github.com/fedspendingtransparency/django-mock-queries#egg=django-mock-queries | ||
mccabe==0.6.1 | ||
mock==3.0.5 | ||
model-mommy==1.6.0 | ||
pycodestyle==2.5.0 | ||
pyflakes==2.1.1 | ||
pytest-cov==2.8.1 | ||
pytest-django==3.5.1 | ||
pytest==4.3.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
django-elasticache==1.0.2 | ||
django-redis==4.8.0 | ||
packaging==16.8 | ||
pylibmc==1.5.2 | ||
pyparsing==2.2.0 | ||
supervisor==4.0.2 | ||
uwsgi==2.0.17.1 |
Oops, something went wrong.