freedomofpress / securethenews

An automated scanner and web dashboard for tracking TLS deployment across news organizations
https://securethe.news
GNU Affero General Public License v3.0
100 stars 25 forks source link

Prod deployment -- act 1 #37

Closed msheiny closed 7 years ago

msheiny commented 7 years ago

Below were the commits that @conorsch and I had to apply to get STN deployed to a staging server. We still have a number of issues that need to get debugged in a future PR:

conorsch commented 7 years ago

Opened separate issues to track the follow-up changes to gulp and debug mode. I'm tempted to open yet another issue to resolve the fixtures madness, but don't have enough info yet—thoughts, @msheiny?

garrettr commented 7 years ago

Re: fixtures madness, I have a theory that it might be due to: http://docs.wagtail.io/en/v1.7/releases/1.7.html#project-template-s-initial-migration-should-not-depend-on-wagtailcore-latest

conorsch commented 7 years ago

@garrettr Believes that the fixtures madness is caused by the role running createsuperuser before the fixtures are applied. That sounds logical! Let's block on merge here until that's resolved—all other changes look good.

garrettr commented 7 years ago

After some review, I'm not sure about the cause of "fixtures madness" anymore. I tried various combinations of running manage.py createsuperuser before manage.py loaddata in an attempt to trigger the error locally, but was unable to do so. I checked the fixture docs and it looks like loaddata always overwrites any conflicting entries in the database, so that probably isn't the cause of the issue.

Since I can't reproduce this locally, and it's only been observed on the production machine, my gut feeling is that the issue is with one of the biggest differences between the development and production environments: sqlite vs. postgres for the db. It's also possible that we're encountering a bug in Wagtail - I just upgraded to 1.7 last week, so it's possible that we're encountering an issue related to that.

I'll look over the Django deployment code and see if I can spot other potential causes.

msheiny commented 7 years ago

Is this branch good to merge in @garrettr / @conorsch ?

conorsch commented 7 years ago

@msheiny I'll open a separate issue to track "fixtures madness", then yes!