-
-
Notifications
You must be signed in to change notification settings - Fork 582
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Conflicts: # cookbook/forms.py
- Loading branch information
Showing
241 changed files
with
41,002 additions
and
9,918 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,11 @@ | ||
[run] | ||
omit = | ||
*/apps.py, | ||
*/migrations/*, | ||
*/settings*, | ||
*/test*, | ||
*/tests/*, | ||
*urls.py, | ||
*/wsgi*, | ||
manage.py, | ||
*__init__* |
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 @@ | ||
FROM python:3.10-alpine3.18 | ||
|
||
#Install all dependencies. | ||
RUN apk add --no-cache postgresql-libs postgresql-client gettext zlib libjpeg libwebp libxml2-dev libxslt-dev openldap git yarn | ||
|
||
#Print all logs without buffering it. | ||
ENV PYTHONUNBUFFERED 1 | ||
|
||
#This port will be used by gunicorn. | ||
EXPOSE 8000 | ||
|
||
#This port will be used by vue | ||
EXPOSE 8080 | ||
|
||
#Install all python dependencies to the image | ||
COPY requirements.txt /tmp/pip-tmp/ | ||
|
||
RUN \ | ||
if [ `apk --print-arch` = "armv7" ]; then \ | ||
printf "[global]\nextra-index-url=https://www.piwheels.org/simple\n" > /etc/pip.conf ; \ | ||
fi | ||
RUN apk add --no-cache --virtual .build-deps gcc musl-dev postgresql-dev zlib-dev jpeg-dev libwebp-dev openssl-dev libffi-dev cargo openldap-dev python3-dev && \ | ||
echo -n "INPUT ( libldap.so )" > /usr/lib/libldap_r.so && \ | ||
pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements.txt && \ | ||
rm -rf /tmp/pip-tmp && \ | ||
apk --purge del .build-deps |
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,27 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. | ||
{ | ||
"name": "Tandoor Dev Container", | ||
"build": { "context": "..", "dockerfile": "Dockerfile" }, | ||
|
||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
// "features": {}, | ||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
"forwardPorts": [8000, 8080], | ||
|
||
// Use 'postCreateCommand' to run commands after the container is created. | ||
// "postCreateCommand": "pip3 install --user -r requirements.txt" | ||
|
||
// Configure tool-specific properties. | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"ms-python.debugpy", | ||
"ms-python.python" | ||
] | ||
} | ||
} | ||
|
||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||
// "remoteUser": "root" | ||
} |
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 |
---|---|---|
|
@@ -3,38 +3,79 @@ name: Continuous Integration | |
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
if: github.repository_owner == 'TandoorRecipes' | ||
runs-on: ubuntu-latest | ||
strategy: | ||
max-parallel: 4 | ||
matrix: | ||
python-version: ['3.10'] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.10' | ||
# Build Vue frontend | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: '18' | ||
- name: Install Vue dependencies | ||
working-directory: ./vue | ||
run: yarn install | ||
- name: Build Vue dependencies | ||
working-directory: ./vue | ||
run: yarn build | ||
- name: Install Django dependencies | ||
run: | | ||
sudo apt-get -y update | ||
sudo apt-get install -y libsasl2-dev python3-dev libldap2-dev libssl-dev | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
python3 manage.py collectstatic --noinput | ||
python3 manage.py collectstatic_js_reverse | ||
- name: Django Testing project | ||
run: | | ||
pytest | ||
build: | ||
if: github.repository_owner == 'TandoorRecipes' | ||
runs-on: ubuntu-latest | ||
strategy: | ||
max-parallel: 4 | ||
matrix: | ||
python-version: ["3.10"] | ||
node-version: ["18"] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: awalsh128/[email protected] | ||
with: | ||
packages: libsasl2-dev python3-dev libldap2-dev libssl-dev | ||
version: 1.0 | ||
|
||
# Setup python & dependencies | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: "pip" | ||
|
||
- name: Install Python Dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
- name: Cache StaticFiles | ||
uses: actions/cache@v4 | ||
id: django_cache | ||
with: | ||
path: | | ||
./cookbook/static | ||
./vue/webpack-stats.json | ||
./staticfiles | ||
key: | | ||
${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.node-version }}-collectstatic-${{ hashFiles('**/*.css', '**/*.js', 'vue/src/*') }} | ||
# Build Vue frontend & Dependencies | ||
- name: Set up Node ${{ matrix.node-version }} | ||
if: steps.django_cache.outputs.cache-hit != 'true' | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: "yarn" | ||
cache-dependency-path: ./vue/yarn.lock | ||
|
||
- name: Install Vue dependencies | ||
if: steps.django_cache.outputs.cache-hit != 'true' | ||
working-directory: ./vue | ||
run: yarn install | ||
|
||
- name: Build Vue dependencies | ||
if: steps.django_cache.outputs.cache-hit != 'true' | ||
working-directory: ./vue | ||
run: yarn build | ||
|
||
- name: Compile Django StaticFiles | ||
if: steps.django_cache.outputs.cache-hit != 'true' | ||
run: | | ||
python3 manage.py collectstatic --noinput | ||
python3 manage.py collectstatic_js_reverse | ||
- uses: actions/cache/save@v4 | ||
if: steps.django_cache.outputs.cache-hit != 'true' | ||
with: | ||
path: | | ||
./cookbook/static | ||
./vue/webpack-stats.json | ||
./staticfiles | ||
key: | | ||
${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.node-version }}-collectstatic-${{ hashFiles('**/*.css', '**/*.js', 'vue/src/*') }} | ||
- name: Django Testing project | ||
run: pytest --junitxml=junit/test-results-${{ matrix.python-version }}.xml |
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,17 +1,20 @@ | ||
name: Make Docs | ||
on: | ||
push: | ||
branches: | ||
- master | ||
# the 1st condition | ||
workflow_run: | ||
workflows: ["Continuous Integration"] | ||
branches: [master] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
deploy: | ||
if: github.repository_owner == 'TandoorRecipes' | ||
if: github.repository_owner == 'TandoorRecipes' && ${{ github.event.workflow_run.conclusion == 'success' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.x | ||
- run: pip install mkdocs-material mkdocs-include-markdown-plugin | ||
- run: mkdocs gh-deploy --force | ||
- run: mkdocs gh-deploy --force |
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,18 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
|
||
{ | ||
"name": "Python Debugger: Django", | ||
"type": "debugpy", | ||
"request": "launch", | ||
"program": "${workspaceFolder}/manage.py", | ||
"args": ["runserver"], | ||
"django": true, | ||
"justMyCode": true | ||
} | ||
] | ||
} |
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,7 @@ | ||
{ | ||
"python.testing.pytestArgs": [ | ||
"cookbook/tests" | ||
], | ||
"python.testing.unittestEnabled": false, | ||
"python.testing.pytestEnabled": true | ||
} |
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,75 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "Run Migrations", | ||
"type": "shell", | ||
"command": "python3 manage.py migrate", | ||
}, | ||
{ | ||
"label": "Collect Static Files", | ||
"type": "shell", | ||
"command": "python3 manage.py collectstatic", | ||
"dependsOn": ["Yarn Build"], | ||
}, | ||
{ | ||
"label": "Setup Dev Server", | ||
"dependsOn": ["Run Migrations", "Yarn Build"], | ||
}, | ||
{ | ||
"label": "Run Dev Server", | ||
"type": "shell", | ||
"dependsOn": ["Setup Dev Server"], | ||
"command": "python3 manage.py runserver", | ||
}, | ||
{ | ||
"label": "Yarn Install", | ||
"type": "shell", | ||
"command": "yarn install", | ||
"options": { | ||
"cwd": "${workspaceFolder}/vue" | ||
} | ||
}, | ||
{ | ||
"label": "Yarn Serve", | ||
"type": "shell", | ||
"command": "yarn serve", | ||
"dependsOn": ["Yarn Install"], | ||
"options": { | ||
"cwd": "${workspaceFolder}/vue" | ||
} | ||
}, | ||
{ | ||
"label": "Yarn Build", | ||
"type": "shell", | ||
"command": "yarn build", | ||
"dependsOn": ["Yarn Install"], | ||
"options": { | ||
"cwd": "${workspaceFolder}/vue" | ||
}, | ||
"group": "build", | ||
}, | ||
{ | ||
"label": "Setup Tests", | ||
"dependsOn": ["Run Migrations", "Collect Static Files"], | ||
}, | ||
{ | ||
"label": "Run all pytests", | ||
"type": "shell", | ||
"command": "python3 -m pytest cookbook/tests", | ||
"dependsOn": ["Setup Tests"], | ||
"group": "test", | ||
}, | ||
{ | ||
"label": "Setup Documentation Dependencies", | ||
"type": "shell", | ||
"command": "pip install mkdocs-material mkdocs-include-markdown-plugin", | ||
}, | ||
{ | ||
"label": "Serve Documentation", | ||
"type": "shell", | ||
"command": "mkdocs serve", | ||
"dependsOn": ["Setup Documentation Dependencies"], | ||
} | ||
] | ||
} |
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.