-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created deployment option for sqlite-backed DB
- Loading branch information
Showing
12 changed files
with
125 additions
and
6 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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
appengine_deploy | ||
templates_compiled.zip | ||
sqlite_deploy |
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,45 @@ | ||
#!/usr/bin/env python | ||
# Copyright 2015 Brett Slatkin | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
"""Bootstraps a new installation by setting up the production environment.""" | ||
|
||
import os | ||
os.environ['YOURAPPLICATION_SETTINGS'] = '../../settings.cfg' | ||
os.environ['SQLITE_PRODUCTION'] = 'Yes' | ||
|
||
from dpxdt.server import db | ||
from dpxdt.server import models | ||
from dpxdt.server import utils | ||
|
||
db.create_all() | ||
|
||
build = models.Build(name='Primary build') | ||
db.session.add(build) | ||
db.session.commit() | ||
|
||
api_key = models.ApiKey( | ||
id=utils.human_uuid(), | ||
secret=utils.password_uuid(), | ||
purpose='Local workers', | ||
superuser=True, | ||
build_id=build.id) | ||
db.session.add(api_key) | ||
db.session.commit() | ||
|
||
db.session.flush() | ||
|
||
with open('flags.cfg', 'a') as f: | ||
f.write('--release_client_id=%s\n' % api_key.id) | ||
f.write('--release_client_secret=%s\n' % api_key.secret) |
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 @@ | ||
../../dpxdt |
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,17 @@ | ||
--port=5000 | ||
--enable_api_server | ||
--enable_queue_workers | ||
--fetch_use_internal_redirects | ||
--release_server_prefix=http://localhost:5000/api | ||
--queue_server_prefix=http://localhost:5000/api/work_queue | ||
--fetch_frequency=10 | ||
--fetch_threads=10 | ||
--capture_threads=10 | ||
--capture_wait_seconds=2 | ||
--phantomjs_timeout=20 | ||
--queue_idle_poll_seconds=30 | ||
--queue_busy_poll_seconds=1 | ||
--pdiff_threads=10 | ||
--pdiff_wait_seconds=2 | ||
--pdiff_timeout=20 | ||
--polltime=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 @@ | ||
../../requirements.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
source bin/activate | ||
pip install -r requirements.txt | ||
pip install -e . | ||
trap "deactivate" 0 | ||
|
||
export YOURAPPLICATION_SETTINGS=../../settings.cfg | ||
export SQLITE_PRODUCTION=Yes | ||
|
||
dpxdt_server --flagfile=flags.cfg |
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 @@ | ||
SQLALCHEMY_DATABASE_URI = 'sqlite:///../../data.db' |
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 @@ | ||
../../setup.py |
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 |
---|---|---|
|
@@ -19,4 +19,4 @@ pyimgur==0.5.2 | |
python-gflags==2.0 | ||
requests==2.5.1 | ||
watchdog==0.8.3 | ||
wsgiref==0.1. | ||
wsgiref==0.1.2 |