Skip to content
This repository has been archived by the owner on Dec 19, 2019. It is now read-only.

Continuous deployment via travis-ci #7

Open
wants to merge 4 commits into
base: feature/heroku
Choose a base branch
from

Conversation

adborden
Copy link
Member

This should be merged before #2

@adborden adborden mentioned this pull request Apr 10, 2017
run: python manage.py migrate
on: master
api_key:
secure: "FE+fi/wY2+LfPP2WZW1Tvvw24+ijldCr7BqIzeeHtKIdu8QK5WOhgdZ8rgkUXtoeGWx3j9vvGeaRCdmQr06kfJ2qk8dsidKSxiAPu3uvL4ppGwqhB+EqgDdMNoUKvStYeBdSNYOpytWYUOdKMu6DPUGwMxGQwItwmtNAHYTZ4ciTno6sdIaFi0/UXoPixGAgvxR+VzgNANy6+86Kl4dO9LMAHmeaPPebmQFOV4WvutEoryHsPklOJHDFEBcUnqRA1YK1FPPZ9Fpy88ZPF6Alx8O0f5B3TxadSgtEqgTMp7FGkpcGE9dh4/Tb6MESm/6l3EANNEEMs9iCqpvA3dboTcSqUkb7yqbEqt5Th5pB/gWxthgvlM25EiE/hCa36jB8kUAO/XjaH1QKBr7SwtvywzDdW4Xn5JXlsunQa3eW/GDUV4oADwRjGjq6kqQADj+FX19jLMR+NhBjZvJ4qQx43wSz8yKBWURl/oN/9B2YuEJJ//OtA8mEtLtL0vphiNXp4T6w/RcVL8hj5Jfe61ULgfX51QwRjbnzXJf0JurvfOZJBbO48K8ZPv0u1FTZ7Bn2QjSGo/bha+IHwUyqjaBEudrpbShE+BQ+YNcBOB2YnR0Zgi1n4snO1uZ3+V0HirtTsiHfDJdSA07l8jDWW4x9lbDFTmXEA6UwYOsOohTwZgc="

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should put this key in an environment variable.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't think you could store Travis deploy secrets in an environment variable. As far as I know, storing encrypted secrets in the Travis config is the preferred way to do this.

@@ -1,5 +1,5 @@
[![Build
Status](https://travis-ci.org/adborden/ballot-api.svg?branch=master)](https://travis-ci.org/adborden/ballot-api)
Status](https://travis-ci.org/caciviclab/ballot-api.svg?branch=master)](https://travis-ci.org/caciviclab/ballot-api)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will we be using the master branch for CI? or do we want to use an integration (or other name) for it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just start with master. If we add additional environments we can change the branch later.

'caciviclab-ballot-api.herokuapp.com',
]

if 'ALLOWED_HOSTS' not in os.environ:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try this:

ALLOWED_HOSTS = os.environ.get('ALLOWED_HOSTS', ['*'])

When it's stored in an env variable, we should be able to format like so:
export ALLOWED_HOSTS="['host.com', 'herokuapp.com', '*.localhost']"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I'll try that.

raise Exception('SECRET_KEY environment variable must be set for heroku configuration.')

SECRET_KEY = os.environ.get('SECRET_KEY')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as for ALLOWED_HOSTS

SECRET_KEY = os.environ.get('SECRET_KEY', 'set_the_secret_key')

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants