-
Notifications
You must be signed in to change notification settings - Fork 1
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 #292 from jwjacobson/tags
Tags
- Loading branch information
Showing
12 changed files
with
227 additions
and
44 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,56 @@ | ||
name: jazztunes CI and Deployment | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
build-and-deploy: | ||
environment: jazztunes | ||
runs-on: ubuntu-latest | ||
strategy: | ||
max-parallel: 4 | ||
matrix: | ||
python-version: [3.11, 3.12] | ||
|
||
# Define service containers for running tests | ||
services: | ||
postgres: | ||
image: postgres | ||
env: | ||
POSTGRES_USER: testuser | ||
POSTGRES_PASSWORD: testpass | ||
POSTGRES_DB: testdb | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
ports: | ||
- 5432:5432 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install Dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
- name: Run Tests | ||
env: | ||
DATABASE_URL: postgres://testuser:testpass@localhost:5432/testdb | ||
ADMIN_USER_ID: ${{ secrets.ADMIN_USER_ID }} | ||
ALLOWED_HOSTS: ${{ secrets.ALLOWED_HOSTS }} | ||
SECRET_KEY: ${{ secrets.SECRET_KEY }} | ||
|
||
run: | | ||
pytest | ||
- name: Deploy to Heroku | ||
env: | ||
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }} | ||
run: | | ||
git fetch --unshallow || true | ||
git push https://heroku:[email protected]/${{ secrets.HEROKU_APP_NAME }}.git HEAD:main -f |
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,16 @@ | ||
""" | ||
This file contains the environment variables you'll need to set in .env for the app to run. | ||
I've supplied some default values that might work well. | ||
""" | ||
# The following are required: | ||
DATABASE_URL=sqlite:///db.sqlite3 | ||
ADMIN_USER_ID=1 | ||
SECRET_KEY='whatever' | ||
DEBUG=True | ||
ALLOWED_HOSTS=127.0.0.1 | ||
|
||
# These are optional: | ||
SENTRY_DSN= | ||
SENDGRID_API_KEY= | ||
DEFAULT_FROM_EMAIL= | ||
PYTHONBREAKPOINT=ipdb.set_trace |
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,34 @@ | ||
# Generated by Django 5.0.4 on 2024-06-22 20:54 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("tune", "0004_alter_repertoiretune_last_played"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="Tag", | ||
fields=[ | ||
( | ||
"id", | ||
models.BigAutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
("name", models.CharField(max_length=20, unique=True)), | ||
], | ||
), | ||
migrations.AddField( | ||
model_name="repertoiretune", | ||
name="tags", | ||
field=models.ManyToManyField( | ||
related_name="repertoire_tunes", to="tune.tag" | ||
), | ||
), | ||
] |
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,19 @@ | ||
# Generated by Django 5.0.4 on 2024-06-26 17:38 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("tune", "0005_tag_repertoiretune_tags"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="repertoiretune", | ||
name="tags", | ||
field=models.ManyToManyField( | ||
blank=True, related_name="repertoire_tunes", to="tune.tag" | ||
), | ||
), | ||
] |
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,22 @@ | ||
# Generated by Django 5.0.4 on 2024-06-26 17:52 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("tune", "0006_alter_repertoiretune_tags"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="repertoiretune", | ||
name="tags", | ||
field=models.ManyToManyField( | ||
blank=True, | ||
help_text="ctrl-click to select more than one", | ||
related_name="repertoire_tunes", | ||
to="tune.tag", | ||
), | ||
), | ||
] |
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.