-
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.
- Loading branch information
Showing
10 changed files
with
196 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
changelog: | ||
categories: | ||
- title: Breaking Changes 🪅 | ||
labels: | ||
- breaking 💔 | ||
|
||
- title: New Features 🎉 | ||
labels: | ||
- enhancement ➕ | ||
|
||
- title: Bugfixes 🐛 | ||
labels: | ||
- bug 🐛 | ||
|
||
- title: Deployment 🚀 | ||
labels: | ||
- production 🎭 | ||
- dev 💻 | ||
|
||
- title: Maintenance 🔩 | ||
labels: | ||
- maintenance 🔧 | ||
- CI 🦾 | ||
- CD 🏗️ | ||
|
||
- title: Documentation 📚 | ||
labels: | ||
- documentation 📜 | ||
|
||
- title: Other Changes | ||
labels: | ||
- '*' |
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,20 @@ | ||
name: 🪂 Deploy | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
release: | ||
types: [published, edited, prereleased] | ||
merge_group: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
name: 🔨 Build and deploy docker image | ||
uses: WGBH-MLA/.github/.github/workflows/build.yml@main | ||
with: | ||
target: production |
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 @@ | ||
name: 🏷 Sync labels | ||
on: | ||
workflow_dispatch: | ||
|
||
permissions: | ||
issues: write | ||
|
||
jobs: | ||
labels: | ||
name: 🔄 Sync labels | ||
uses: WGBH-MLA/.github/.github/workflows/labels.yml@main | ||
|
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 @@ | ||
name: 📦 Release | ||
|
||
on: | ||
milestone: | ||
types: [closed] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
release: | ||
name: 📝 Draft Release | ||
uses: WGBH-MLA/.github/.github/workflows/draft_release.yml@main |
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 @@ | ||
name: 🛍 Update dependencies | ||
# On Wednesdays, we update our dependencies. | ||
|
||
on: | ||
schedule: | ||
- cron: 0 12 * * 3 | ||
workflow_dispatch: | ||
|
||
jobs: | ||
update: | ||
name: 🦿 Update dependencies | ||
uses: WGBH-MLA/.github/.github/workflows/update.yml@main |
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,24 +1,67 @@ | ||
########################### | ||
# 'base' build stage, common to all build stages | ||
########################### | ||
FROM python as base | ||
FROM python:3.11-slim as base | ||
|
||
# Set working dir to /app, where all code lives. | ||
WORKDIR /app | ||
RUN pip install -U pip | ||
RUN pip install -U pip pdm | ||
|
||
# Copy app code to container | ||
COPY pyproject.toml pdm.lock ./ | ||
COPY pyproject.toml pdm.lock README.md ./ | ||
COPY organ organ | ||
|
||
# add app directories | ||
ADD organ/ organ/ | ||
ADD static/ static/ | ||
ADD templates/ templates/ | ||
# Copy migration files | ||
# COPY alembic.ini ./ | ||
# COPY migrations migrations | ||
|
||
# Install PDM dependency manager | ||
RUN pip install pdm | ||
|
||
########################### | ||
# 'dev' build stage | ||
########################### | ||
FROM base as dev | ||
# Configure pdm to instal dependencies into ./__pypyackages__/ | ||
RUN pdm config python.use_venv false | ||
# Configure python to use pep582 with local __pypyackages__ | ||
ENV PYTHONPATH=/usr/local/lib/python3.11/site-packages/pdm/pep582 | ||
ENV PATH=$PATH:/app/__pypackages__/3.11/bin/ | ||
# Add local packages to $PATH | ||
ENV PATH=/app/__pypackages__/3.11/bin/:$PATH | ||
|
||
# Install dev dependencies with pdm | ||
RUN pdm install -G dev | ||
# Start dev server. | ||
CMD uvicorn organ.app:app --host 0.0.0.0 --reload --log-level debug | ||
|
||
|
||
########################### | ||
# 'build' build stage for production | ||
############################ | ||
FROM base as build | ||
RUN apt update && apt install -y gcc libpq-dev git | ||
|
||
RUN pdm config venv.with_pip True | ||
RUN pdm install -G production | ||
|
||
# Install pip into the virtual environment | ||
RUN /app/.venv/bin/python -m ensurepip | ||
|
||
########################### | ||
# 'production' final production image | ||
############################ | ||
FROM python:3.11-slim as production | ||
WORKDIR /app | ||
|
||
RUN apt update && apt install -y libpq-dev | ||
RUN apt-get autoremove -y \ | ||
&& apt-get clean -y \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
COPY --from=build /app/ /app/ | ||
COPY templates templates | ||
COPY static static | ||
|
||
ENV organ_ENV=production | ||
ENV PATH="/app/.venv/bin:$PATH" | ||
|
||
RUN pdm install -v | ||
EXPOSE 8000 | ||
|
||
# CMD gunicorn chowda:app -b 0.0.0.0:8000 -w 2 --worker-class uvicorn.workers.UvicornWorker | ||
CMD uvicorn organ:main --host 0.0.0.0 --port 8000 | ||
CMD gunicorn organ.main:main -b 0.0.0.0:8000 -w 2 --worker-class uvicorn.workers.UvicornWorker |
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,3 @@ | ||
# Organ | ||
|
||
Organization name resolution for Open Vault and the American Archive of Public Broadcasting |
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