forked from TabbycatDebate/tabbycat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure settings exclusivity among deployments; add render settings/build
- Loading branch information
1 parent
610c967
commit 5635c64
Showing
14 changed files
with
306 additions
and
34 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,26 @@ | ||
#!/usr/bin/env bash | ||
# exit on error | ||
set -o errexit | ||
|
||
echo "-----> Install dependencies" | ||
python -m pip install pipenv | ||
pipenv install --system | ||
|
||
echo "-----> I'm post-compile hook" | ||
cd ./tabbycat/ | ||
|
||
echo "-----> Running database migration" | ||
python manage.py migrate --noinput | ||
|
||
echo "-----> Running dynamic preferences checks" | ||
python manage.py checkpreferences | ||
|
||
echo "-----> Running static asset compilation" | ||
npm install -g @vue/cli-service-global | ||
npm install | ||
npm run build | ||
|
||
echo "-----> Running static files compilation" | ||
python manage.py collectstatic --noinput | ||
|
||
echo "-----> Post-compile done" |
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 @@ | ||
.. _install-render: | ||
|
||
==================== | ||
Installing on Render | ||
==================== | ||
|
||
Render is a web hosting platform, similar to Heroku. Like Heroku, it provides a similar '1 click' method of deployment that should be approachable to people without experience in deploying web applications. Support for deploying Tabbycat to Render is currently **in beta**. | ||
|
||
.. admonition:: Warning | ||
:class: warning | ||
|
||
The most important difference between Render and Heroku is that **after 90 days, Render's free-tier database will stop working and delete all your data**. If you want to keep your tab data around for the long term, you must backup your data and host it elsewhere after the tournament ends | ||
|
||
Please also note: | ||
|
||
- Although Tabbycat is setup to run within the free-tier of Render, you may need to add a credit card to your account in order to create your account | ||
- While Render might run faster for small tournaments, we are unclear how well it runs at a larger scale and how best to employ Render's scaling tools | ||
|
||
To deploy to Render, follow the instructions below. | ||
|
||
1. Signup | ||
========= | ||
|
||
`Follow this link <https://dashboard.render.com/register?next=/>`_ and sign-up for the Render service. Login when finished, and navigate to your *Dashboard*. | ||
|
||
2. Setup | ||
======== | ||
|
||
.. image:: https://render.com/images/deploy-to-render-button.svg | ||
:target: https://render.com/deploy?repo=https://github.com/TabbycatDebate/tabbycat/ | ||
|
||
Click the button above. Enter whatever you want as the **Service Group Name** and leave "Branch" as it is. | ||
|
||
Then, enter your email and Time Zone in the fields. Time zones are formatted as per Heroku — copy of a "TZ database name" `from this list <https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List>`_, e.g. *Europe/Copenhagen*. | ||
|
||
Then, click "Apply" at the bottom of the page. The button will disappear. | ||
|
||
Wait it a few minutes then go to your *Dashboard*. It may take up to 30 minutes for all items have a *STATUS* of "Deploy succeeded" or "Available" and you may need to refresh the page to see these updated status. | ||
|
||
3. Login | ||
======== | ||
|
||
When everything is successful/available, click through to the "Web Service" item on your Render Dashboard to see the URL of your site below the title. Open the URL to complete the normal Tabbycat admin account setup. | ||
|
||
Note that this URL cannot be changed unless you `add a custom domain using a URL you already own <https://render.com/docs/custom-domains>`_. |
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,48 @@ | ||
databases: | ||
- name: tabbycat_database | ||
databaseName: tabbycat | ||
user: tabbycat | ||
plan: free | ||
|
||
services: | ||
- type: web | ||
name: tabbycat_website | ||
env: python | ||
plan: free | ||
region: oregon | ||
buildCommand: "./bin/render-compile.sh" | ||
startCommand: "npm run serve-render" | ||
envVars: | ||
- key: DATABASE_URL | ||
fromDatabase: | ||
name: tabbycat_database | ||
property: connectionString | ||
- key: REDIS_HOST | ||
fromService: | ||
type: redis | ||
name: tabbycat_redis | ||
property: host | ||
- key: REDIS_PORT | ||
fromService: | ||
type: redis | ||
name: tabbycat_redis | ||
property: port | ||
- key: DJANGO_SECRET_KEY | ||
generateValue: true | ||
- key: PYTHON_VERSION | ||
value: "3.9.9" | ||
- key: WEB_CONCURRENCY | ||
value: 4 | ||
- key: TAB_DIRECTOR_EMAIL | ||
sync: false | ||
- key: TIME_ZONE | ||
sync: false | ||
- key: ON_RENDER | ||
value: true | ||
- type: redis | ||
name: tabbycat_redis | ||
ipAllowList: # required | ||
- source: 0.0.0.0 | ||
description: everywhere | ||
plan: free | ||
maxmemoryPolicy: allkeys-lru # (default) |
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 |
---|---|---|
|
@@ -4,6 +4,8 @@ | |
|
||
import os | ||
|
||
print("Imported docker settings") | ||
|
||
ALLOWED_HOSTS = ["*"] | ||
|
||
DATABASES = { | ||
|
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
Oops, something went wrong.