Родитель
5c657ab0a3
Коммит
ec67403fb8
|
@ -0,0 +1,25 @@
|
|||
language: python
|
||||
cache: pip
|
||||
|
||||
python:
|
||||
- "3.6"
|
||||
|
||||
services: postgresql
|
||||
|
||||
# command to install dependencies
|
||||
install: "pip install -r requirements.txt"
|
||||
|
||||
before_script:
|
||||
- psql -c "CREATE DATABASE pulseapi;" -U postgres
|
||||
- python manage.py migrate
|
||||
|
||||
# command to run tests
|
||||
script:
|
||||
- python manage.py test
|
||||
|
||||
env:
|
||||
global:
|
||||
- DEBUG=True
|
||||
- REDIRECT_URIS=http://test.example.com:8000/api/pulse/oauth2callback
|
||||
- SSL_PROTECTION=False
|
||||
- DATABASE_URL=postgres://postgres:5432@localhost:5432/pulseapi
|
|
@ -1,3 +1,5 @@
|
|||
[![Travis Build Status](https://travis-ci.org/mozilla/network-pulse-api.svg?branch=master)](https://travis-ci.org/mozilla/network-pulse-api) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/mozilla/network-pulse-api?svg=true)](https://ci.appveyor.com/project/mozillafoundation/network-pulse-api)
|
||||
|
||||
# The Mozilla Foundation Network Pulse API Server
|
||||
|
||||
This is the REST API server for the Mozilla Network Pulse project.
|
||||
|
@ -214,8 +216,8 @@ The following environment variables are used in this codebase
|
|||
- `TOKEN_URI`: optional, defaults to 'https://accounts.google.com/o/oauth2/token' and there is no reason to change it.
|
||||
- `SSL_PROTECTION`: Defaults to `False` to make development easier, but if you're deploying you probably want this to be `True`. This sets a slew of security-related variables in `settings.py` that you can override individually if desired.
|
||||
Heroku provisions some environmnets on its own, like a `PORT` and `DATABASE_URL` variable, which this codebase will make use of if it sees them, but these values are only really relevant to Heroku deployments and not something you need to mess with for local development purposes.
|
||||
|
||||
|
||||
|
||||
|
||||
## Deploying to Heroku
|
||||
|
||||
While for local development we provide a `sample.env` that you can use as default environment variables, for Heroku deployment all the above-stated variables need to be real things. **Make sure to add these to the Heroku config!**
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
version: "{build}"
|
||||
|
||||
branches:
|
||||
|
||||
only:
|
||||
|
||||
- master
|
||||
|
||||
clone_depth: 1
|
||||
|
||||
build: false
|
||||
|
||||
environment:
|
||||
DEBUG: True
|
||||
REDIRECT_URIS: http://test.example.com:8000/api/pulse/oauth2callback
|
||||
SSL_PROTECTION: False
|
||||
DATABASE_URL: postgres://postgres:Password12!@localhost:5432/pulseapi
|
||||
|
||||
matrix:
|
||||
- PYTHON: "C:\\Python36"
|
||||
PYTHON_VERSION: "3.6.1"
|
||||
PYTHON_ARCH: "32"
|
||||
|
||||
init:
|
||||
- "ECHO %PYTHON% %PYTHON_VERSION% %%PYTHON_ARCH"
|
||||
|
||||
install:
|
||||
- "virtualenv pulseapi -p %PYTHON%/python.exe"
|
||||
- "./pulseapi/Scripts/activate"
|
||||
- "pip install -r requirements.txt"
|
||||
|
||||
services:
|
||||
- postgresql
|
||||
|
||||
before_test:
|
||||
- "./pulseapi/Scripts/activate"
|
||||
- SET PGUSER=postgres
|
||||
- SET PGPASSWORD=Password12!
|
||||
- PATH=C:\Program Files\PostgreSQL\9.6\bin\;%PATH%
|
||||
- createdb pulseapi
|
||||
- python manage.py migrate
|
||||
|
||||
test_script:
|
||||
- "./pulseapi/Scripts/activate"
|
||||
- "python manage.py test"
|
||||
|
Загрузка…
Ссылка в новой задаче