-
Notifications
You must be signed in to change notification settings - Fork 55
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 #4140 from magfest/upgrade-local-dev
Improve local development experience
- Loading branch information
Showing
5 changed files
with
114 additions
and
37 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import os | ||
import sys | ||
import atexit | ||
import readline | ||
import rlcompleter | ||
import traceback | ||
from pprint import pprint | ||
|
||
|
||
readline.parse_and_bind('tab: complete') | ||
history_path = os.path.expanduser('~/.pyhistory') | ||
|
||
|
||
@atexit.register | ||
def save_history(): | ||
readline.write_history_file(history_path) | ||
|
||
|
||
if os.path.exists(history_path): | ||
readline.read_history_file(history_path) | ||
|
||
try: | ||
import cherrypy | ||
import sideboard | ||
from uber.config import c | ||
from uber.models import AdminAccount, Attendee, initialize_db, Session | ||
|
||
initialize_db() | ||
|
||
# Make it easier to do session stuff at the command line | ||
session = Session().session | ||
|
||
admin = session.query(AdminAccount).filter( | ||
AdminAccount.attendee_id == Attendee.id, | ||
Attendee.email == '[email protected]' | ||
).order_by(AdminAccount.id).first() | ||
|
||
if admin: | ||
# Make it easier to do site section testing at the command line | ||
cherrypy.session = {'account_id': admin.id} | ||
print('Logged in as {} <{}>'.format(admin.attendee.full_name, admin.attendee.email)) | ||
else: | ||
print('INFO: Could not find Test Developer admin account') | ||
|
||
except Exception as ex: | ||
print('ERROR: Could not initialize ubersystem environment') | ||
traceback.print_exc() |
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
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,12 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# This will replace any variable references in these files | ||
# If you want to add any additional settings here just add | ||
# the variables to the environment when running this. | ||
envsubst < "uber-development.ini.template" > /app/plugins/uber/development.ini | ||
envsubst < "sideboard-development.ini.template" > /app/development.ini | ||
|
||
if [ "$1" = 'git' ]; then | ||
/app/env/bin/python /app/plugins/uber/make_config.py --repo https://github.com/magfest/terraform-aws-magfest.git --paths uber_config/environments/dev uber_config/events/$2 uber_config/events/$2/$3 | ||
fi |