diff --git a/Dockerfile b/Dockerfile index 695a32b..9d4c621 100644 --- a/Dockerfile +++ b/Dockerfile @@ -43,11 +43,9 @@ COPY --from=venv /app/venv /app/venv/ ENV PATH /app/venv/bin:$PATH WORKDIR /app -COPY manage.py LICENSE pyproject.toml ./ +COPY LICENSE pyproject.toml ./ COPY docker ./docker/ -COPY blog ./blog/ -COPY attachments ./attachments/ -COPY articles ./articles/ +COPY src ./src/ COPY --from=git /version /app/.version ENV SECRET_KEY "changeme" diff --git a/README.md b/README.md index bef36ac..0f0ddbd 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,5 @@ Hosted at https://gabnotes.org ## Development ```shell inv test-cov -inv publish -inv deploy +inv build publish deploy ``` diff --git a/docker/nginx.conf b/docker/nginx.conf deleted file mode 100644 index 0696632..0000000 --- a/docker/nginx.conf +++ /dev/null @@ -1,42 +0,0 @@ -server { - server_name localhost:8000; - - client_max_body_size 10M; - - gzip on; - gzip_types - application/javascript - application/x-javascript - application/json - application/rss+xml - application/xml - application/vnd.ms-fontobject - application/font-sfnt - image/svg+xml - image/x-icon - text/xml - text/javascript - text/css - text/plain; - gzip_min_length 256; - gzip_comp_level 5; - gzip_http_version 1.1; - gzip_vary on; - - location /media/ { - alias /app/media/; - expires 30d; - } - - location / { - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $remote_addr; - proxy_set_header X-Forwarded-Proto https; - proxy_pass http://django:8000; - proxy_redirect off; - } - - listen [::]:80; - listen 80; -} diff --git a/docker/run.sh b/docker/run.sh index eea42c6..a25776d 100755 --- a/docker/run.sh +++ b/docker/run.sh @@ -1,5 +1,4 @@ #!/bin/bash set -eux python manage.py migrate --noinput -python manage.py collectstatic --noinput --clear gunicorn blog.wsgi -b 0.0.0.0:8000 --log-file - diff --git a/docker/runtests.sh b/docker/runtests.sh deleted file mode 100755 index 08cae94..0000000 --- a/docker/runtests.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -set -euxo pipefail -python -m pytest -pre-commit run --all-files -python manage.py makemigrations --check diff --git a/pyproject.toml b/pyproject.toml index 77619ee..caf09a6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,22 +1,3 @@ -[tool.black] -target-version = ['py38'] - -[tool.isort] -profile = "black" - -[tool.pytest.ini_options] -addopts = "--color=yes" -minversion = "6.0" -DJANGO_SETTINGS_MODULE = "blog.settings" -testpaths = [ - "articles", - "blog", - "attachments", -] -env = [ - "GOATCOUNTER_DOMAIN=gc.gabnotes.org" -] - [tool.poetry] name = "blog" version = "0.1.0" @@ -54,6 +35,23 @@ pytest-env = "^0.6.2" poetry-deps-scanner = "^1.0.1" invoke = "^1.6.0" +[tool.black] +target-version = ['py38'] + +[tool.isort] +profile = "black" + +[tool.pytest.ini_options] +addopts = "--color=yes" +minversion = "6.0" +DJANGO_SETTINGS_MODULE = "blog.settings" +testpaths = [ + "src", +] +env = [ + "GOATCOUNTER_DOMAIN=gc.gabnotes.org" +] + [build-system] requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api" diff --git a/articles/__init__.py b/src/articles/__init__.py similarity index 100% rename from articles/__init__.py rename to src/articles/__init__.py diff --git a/articles/admin.py b/src/articles/admin.py similarity index 100% rename from articles/admin.py rename to src/articles/admin.py diff --git a/articles/apps.py b/src/articles/apps.py similarity index 100% rename from articles/apps.py rename to src/articles/apps.py diff --git a/articles/context_processors.py b/src/articles/context_processors.py similarity index 100% rename from articles/context_processors.py rename to src/articles/context_processors.py diff --git a/articles/markdown.py b/src/articles/markdown.py similarity index 100% rename from articles/markdown.py rename to src/articles/markdown.py diff --git a/articles/migrations/0001_initial.py b/src/articles/migrations/0001_initial.py similarity index 100% rename from articles/migrations/0001_initial.py rename to src/articles/migrations/0001_initial.py diff --git a/articles/migrations/0002_article.py b/src/articles/migrations/0002_article.py similarity index 100% rename from articles/migrations/0002_article.py rename to src/articles/migrations/0002_article.py diff --git a/articles/migrations/0003_auto_20200814_1522.py b/src/articles/migrations/0003_auto_20200814_1522.py similarity index 100% rename from articles/migrations/0003_auto_20200814_1522.py rename to src/articles/migrations/0003_auto_20200814_1522.py diff --git a/articles/migrations/0004_article_views_count.py b/src/articles/migrations/0004_article_views_count.py similarity index 100% rename from articles/migrations/0004_article_views_count.py rename to src/articles/migrations/0004_article_views_count.py diff --git a/articles/migrations/0005_article_slug.py b/src/articles/migrations/0005_article_slug.py similarity index 100% rename from articles/migrations/0005_article_slug.py rename to src/articles/migrations/0005_article_slug.py diff --git a/articles/migrations/0006_page.py b/src/articles/migrations/0006_page.py similarity index 100% rename from articles/migrations/0006_page.py rename to src/articles/migrations/0006_page.py diff --git a/articles/migrations/0007_auto_20200817_0941.py b/src/articles/migrations/0007_auto_20200817_0941.py similarity index 100% rename from articles/migrations/0007_auto_20200817_0941.py rename to src/articles/migrations/0007_auto_20200817_0941.py diff --git a/articles/migrations/0008_auto_20200817_1748.py b/src/articles/migrations/0008_auto_20200817_1748.py similarity index 100% rename from articles/migrations/0008_auto_20200817_1748.py rename to src/articles/migrations/0008_auto_20200817_1748.py diff --git a/articles/migrations/0009_comment.py b/src/articles/migrations/0009_comment.py similarity index 100% rename from articles/migrations/0009_comment.py rename to src/articles/migrations/0009_comment.py diff --git a/articles/migrations/0010_auto_20200818_1825.py b/src/articles/migrations/0010_auto_20200818_1825.py similarity index 100% rename from articles/migrations/0010_auto_20200818_1825.py rename to src/articles/migrations/0010_auto_20200818_1825.py diff --git a/articles/migrations/0011_auto_20200818_1829.py b/src/articles/migrations/0011_auto_20200818_1829.py similarity index 100% rename from articles/migrations/0011_auto_20200818_1829.py rename to src/articles/migrations/0011_auto_20200818_1829.py diff --git a/articles/migrations/0012_auto_20200818_1845.py b/src/articles/migrations/0012_auto_20200818_1845.py similarity index 100% rename from articles/migrations/0012_auto_20200818_1845.py rename to src/articles/migrations/0012_auto_20200818_1845.py diff --git a/articles/migrations/0013_auto_20200818_1912.py b/src/articles/migrations/0013_auto_20200818_1912.py similarity index 100% rename from articles/migrations/0013_auto_20200818_1912.py rename to src/articles/migrations/0013_auto_20200818_1912.py diff --git a/articles/migrations/0014_auto_20200818_1952.py b/src/articles/migrations/0014_auto_20200818_1952.py similarity index 100% rename from articles/migrations/0014_auto_20200818_1952.py rename to src/articles/migrations/0014_auto_20200818_1952.py diff --git a/articles/migrations/0015_auto_20200818_2138.py b/src/articles/migrations/0015_auto_20200818_2138.py similarity index 100% rename from articles/migrations/0015_auto_20200818_2138.py rename to src/articles/migrations/0015_auto_20200818_2138.py diff --git a/articles/migrations/0016_comment_user_notified.py b/src/articles/migrations/0016_comment_user_notified.py similarity index 100% rename from articles/migrations/0016_comment_user_notified.py rename to src/articles/migrations/0016_comment_user_notified.py diff --git a/articles/migrations/0017_auto_20200820_1606.py b/src/articles/migrations/0017_auto_20200820_1606.py similarity index 100% rename from articles/migrations/0017_auto_20200820_1606.py rename to src/articles/migrations/0017_auto_20200820_1606.py diff --git a/articles/migrations/0018_auto_20200821_1232.py b/src/articles/migrations/0018_auto_20200821_1232.py similarity index 100% rename from articles/migrations/0018_auto_20200821_1232.py rename to src/articles/migrations/0018_auto_20200821_1232.py diff --git a/articles/migrations/0019_article_comments_allowed.py b/src/articles/migrations/0019_article_comments_allowed.py similarity index 100% rename from articles/migrations/0019_article_comments_allowed.py rename to src/articles/migrations/0019_article_comments_allowed.py diff --git a/articles/migrations/0020_auto_20200903_2157.py b/src/articles/migrations/0020_auto_20200903_2157.py similarity index 100% rename from articles/migrations/0020_auto_20200903_2157.py rename to src/articles/migrations/0020_auto_20200903_2157.py diff --git a/articles/migrations/0021_auto_20201110_1623.py b/src/articles/migrations/0021_auto_20201110_1623.py similarity index 100% rename from articles/migrations/0021_auto_20201110_1623.py rename to src/articles/migrations/0021_auto_20201110_1623.py diff --git a/articles/migrations/0022_article_keywords.py b/src/articles/migrations/0022_article_keywords.py similarity index 100% rename from articles/migrations/0022_article_keywords.py rename to src/articles/migrations/0022_article_keywords.py diff --git a/articles/migrations/0023_article_has_code.py b/src/articles/migrations/0023_article_has_code.py similarity index 100% rename from articles/migrations/0023_article_has_code.py rename to src/articles/migrations/0023_article_has_code.py diff --git a/articles/migrations/0024_auto_20201224_1746.py b/src/articles/migrations/0024_auto_20201224_1746.py similarity index 100% rename from articles/migrations/0024_auto_20201224_1746.py rename to src/articles/migrations/0024_auto_20201224_1746.py diff --git a/articles/migrations/0025_article_custom_css.py b/src/articles/migrations/0025_article_custom_css.py similarity index 100% rename from articles/migrations/0025_article_custom_css.py rename to src/articles/migrations/0025_article_custom_css.py diff --git a/articles/migrations/0026_article_draft_key.py b/src/articles/migrations/0026_article_draft_key.py similarity index 100% rename from articles/migrations/0026_article_draft_key.py rename to src/articles/migrations/0026_article_draft_key.py diff --git a/articles/migrations/0027_auto_20210303_1633.py b/src/articles/migrations/0027_auto_20210303_1633.py similarity index 100% rename from articles/migrations/0027_auto_20210303_1633.py rename to src/articles/migrations/0027_auto_20210303_1633.py diff --git a/articles/migrations/0028_remove_article_keywords.py b/src/articles/migrations/0028_remove_article_keywords.py similarity index 100% rename from articles/migrations/0028_remove_article_keywords.py rename to src/articles/migrations/0028_remove_article_keywords.py diff --git a/articles/migrations/0029_auto_20210303_1711.py b/src/articles/migrations/0029_auto_20210303_1711.py similarity index 100% rename from articles/migrations/0029_auto_20210303_1711.py rename to src/articles/migrations/0029_auto_20210303_1711.py diff --git a/articles/migrations/0030_tag_slug.py b/src/articles/migrations/0030_tag_slug.py similarity index 100% rename from articles/migrations/0030_tag_slug.py rename to src/articles/migrations/0030_tag_slug.py diff --git a/articles/migrations/0031_auto_20210306_1449.py b/src/articles/migrations/0031_auto_20210306_1449.py similarity index 100% rename from articles/migrations/0031_auto_20210306_1449.py rename to src/articles/migrations/0031_auto_20210306_1449.py diff --git a/articles/migrations/0032_auto_20210306_1449.py b/src/articles/migrations/0032_auto_20210306_1449.py similarity index 100% rename from articles/migrations/0032_auto_20210306_1449.py rename to src/articles/migrations/0032_auto_20210306_1449.py diff --git a/articles/migrations/__init__.py b/src/articles/migrations/__init__.py similarity index 100% rename from articles/migrations/__init__.py rename to src/articles/migrations/__init__.py diff --git a/articles/models.py b/src/articles/models.py similarity index 100% rename from articles/models.py rename to src/articles/models.py diff --git a/articles/static/admin_articles.css b/src/articles/static/admin_articles.css similarity index 100% rename from articles/static/admin_articles.css rename to src/articles/static/admin_articles.css diff --git a/articles/static/admonitions.css b/src/articles/static/admonitions.css similarity index 100% rename from articles/static/admonitions.css rename to src/articles/static/admonitions.css diff --git a/articles/static/authenticated.css b/src/articles/static/authenticated.css similarity index 100% rename from articles/static/authenticated.css rename to src/articles/static/authenticated.css diff --git a/articles/static/copy-code.js b/src/articles/static/copy-code.js similarity index 100% rename from articles/static/copy-code.js rename to src/articles/static/copy-code.js diff --git a/articles/static/edit-keymap.js b/src/articles/static/edit-keymap.js similarity index 100% rename from articles/static/edit-keymap.js rename to src/articles/static/edit-keymap.js diff --git a/articles/static/icons/android-chrome-96x96.png b/src/articles/static/icons/android-chrome-96x96.png similarity index 100% rename from articles/static/icons/android-chrome-96x96.png rename to src/articles/static/icons/android-chrome-96x96.png diff --git a/articles/static/icons/apple-touch-icon.png b/src/articles/static/icons/apple-touch-icon.png similarity index 100% rename from articles/static/icons/apple-touch-icon.png rename to src/articles/static/icons/apple-touch-icon.png diff --git a/articles/static/icons/browserconfig.xml b/src/articles/static/icons/browserconfig.xml similarity index 100% rename from articles/static/icons/browserconfig.xml rename to src/articles/static/icons/browserconfig.xml diff --git a/articles/static/icons/favicon-16x16.png b/src/articles/static/icons/favicon-16x16.png similarity index 100% rename from articles/static/icons/favicon-16x16.png rename to src/articles/static/icons/favicon-16x16.png diff --git a/articles/static/icons/favicon-32x32.png b/src/articles/static/icons/favicon-32x32.png similarity index 100% rename from articles/static/icons/favicon-32x32.png rename to src/articles/static/icons/favicon-32x32.png diff --git a/articles/static/icons/favicon.ico b/src/articles/static/icons/favicon.ico similarity index 100% rename from articles/static/icons/favicon.ico rename to src/articles/static/icons/favicon.ico diff --git a/articles/static/icons/mstile-150x150.png b/src/articles/static/icons/mstile-150x150.png similarity index 100% rename from articles/static/icons/mstile-150x150.png rename to src/articles/static/icons/mstile-150x150.png diff --git a/articles/static/icons/safari-pinned-tab.svg b/src/articles/static/icons/safari-pinned-tab.svg similarity index 100% rename from articles/static/icons/safari-pinned-tab.svg rename to src/articles/static/icons/safari-pinned-tab.svg diff --git a/articles/static/icons/site.webmanifest b/src/articles/static/icons/site.webmanifest similarity index 100% rename from articles/static/icons/site.webmanifest rename to src/articles/static/icons/site.webmanifest diff --git a/articles/static/live-preview.js b/src/articles/static/live-preview.js similarity index 100% rename from articles/static/live-preview.js rename to src/articles/static/live-preview.js diff --git a/articles/static/public.css b/src/articles/static/public.css similarity index 100% rename from articles/static/public.css rename to src/articles/static/public.css diff --git a/articles/static/vendor/codehilite.css b/src/articles/static/vendor/codehilite.css similarity index 100% rename from articles/static/vendor/codehilite.css rename to src/articles/static/vendor/codehilite.css diff --git a/articles/static/vendor/goatcounter.js b/src/articles/static/vendor/goatcounter.js similarity index 100% rename from articles/static/vendor/goatcounter.js rename to src/articles/static/vendor/goatcounter.js diff --git a/articles/static/vendor/newcss.css b/src/articles/static/vendor/newcss.css similarity index 100% rename from articles/static/vendor/newcss.css rename to src/articles/static/vendor/newcss.css diff --git a/articles/templates/admin/articles/article/submit_line.html b/src/articles/templates/admin/articles/article/submit_line.html similarity index 100% rename from articles/templates/admin/articles/article/submit_line.html rename to src/articles/templates/admin/articles/article/submit_line.html diff --git a/articles/templates/articles/article_change_form.html b/src/articles/templates/articles/article_change_form.html similarity index 100% rename from articles/templates/articles/article_change_form.html rename to src/articles/templates/articles/article_change_form.html diff --git a/articles/templates/articles/article_detail.html b/src/articles/templates/articles/article_detail.html similarity index 100% rename from articles/templates/articles/article_detail.html rename to src/articles/templates/articles/article_detail.html diff --git a/articles/templates/articles/article_list.html b/src/articles/templates/articles/article_list.html similarity index 100% rename from articles/templates/articles/article_list.html rename to src/articles/templates/articles/article_list.html diff --git a/articles/templates/articles/article_search.html b/src/articles/templates/articles/article_search.html similarity index 100% rename from articles/templates/articles/article_search.html rename to src/articles/templates/articles/article_search.html diff --git a/articles/templates/articles/base.html b/src/articles/templates/articles/base.html similarity index 100% rename from articles/templates/articles/base.html rename to src/articles/templates/articles/base.html diff --git a/articles/templates/articles/snippets/admin_link.html b/src/articles/templates/articles/snippets/admin_link.html similarity index 100% rename from articles/templates/articles/snippets/admin_link.html rename to src/articles/templates/articles/snippets/admin_link.html diff --git a/articles/templates/articles/snippets/analytics.html b/src/articles/templates/articles/snippets/analytics.html similarity index 100% rename from articles/templates/articles/snippets/analytics.html rename to src/articles/templates/articles/snippets/analytics.html diff --git a/articles/templates/articles/snippets/analytics_head.html b/src/articles/templates/articles/snippets/analytics_head.html similarity index 100% rename from articles/templates/articles/snippets/analytics_head.html rename to src/articles/templates/articles/snippets/analytics_head.html diff --git a/articles/templates/articles/snippets/datetime.html b/src/articles/templates/articles/snippets/datetime.html similarity index 100% rename from articles/templates/articles/snippets/datetime.html rename to src/articles/templates/articles/snippets/datetime.html diff --git a/articles/templates/articles/snippets/favicon.html b/src/articles/templates/articles/snippets/favicon.html similarity index 100% rename from articles/templates/articles/snippets/favicon.html rename to src/articles/templates/articles/snippets/favicon.html diff --git a/articles/templates/articles/snippets/metadata.html b/src/articles/templates/articles/snippets/metadata.html similarity index 100% rename from articles/templates/articles/snippets/metadata.html rename to src/articles/templates/articles/snippets/metadata.html diff --git a/articles/templates/articles/snippets/navigation.html b/src/articles/templates/articles/snippets/navigation.html similarity index 100% rename from articles/templates/articles/snippets/navigation.html rename to src/articles/templates/articles/snippets/navigation.html diff --git a/articles/templates/articles/snippets/page_metadata.html b/src/articles/templates/articles/snippets/page_metadata.html similarity index 100% rename from articles/templates/articles/snippets/page_metadata.html rename to src/articles/templates/articles/snippets/page_metadata.html diff --git a/articles/tests/__init__.py b/src/articles/tests/__init__.py similarity index 100% rename from articles/tests/__init__.py rename to src/articles/tests/__init__.py diff --git a/articles/tests/conftest.py b/src/articles/tests/conftest.py similarity index 100% rename from articles/tests/conftest.py rename to src/articles/tests/conftest.py diff --git a/articles/tests/test_admin.py b/src/articles/tests/test_admin.py similarity index 100% rename from articles/tests/test_admin.py rename to src/articles/tests/test_admin.py diff --git a/articles/tests/test_api_views.py b/src/articles/tests/test_api_views.py similarity index 100% rename from articles/tests/test_api_views.py rename to src/articles/tests/test_api_views.py diff --git a/articles/tests/test_feed_views.py b/src/articles/tests/test_feed_views.py similarity index 100% rename from articles/tests/test_feed_views.py rename to src/articles/tests/test_feed_views.py diff --git a/articles/tests/test_html_views.py b/src/articles/tests/test_html_views.py similarity index 100% rename from articles/tests/test_html_views.py rename to src/articles/tests/test_html_views.py diff --git a/articles/tests/test_migrations.py b/src/articles/tests/test_migrations.py similarity index 100% rename from articles/tests/test_migrations.py rename to src/articles/tests/test_migrations.py diff --git a/articles/tests/test_models.py b/src/articles/tests/test_models.py similarity index 100% rename from articles/tests/test_models.py rename to src/articles/tests/test_models.py diff --git a/articles/urls.py b/src/articles/urls.py similarity index 100% rename from articles/urls.py rename to src/articles/urls.py diff --git a/articles/utils.py b/src/articles/utils.py similarity index 100% rename from articles/utils.py rename to src/articles/utils.py diff --git a/articles/views/__init__.py b/src/articles/views/__init__.py similarity index 100% rename from articles/views/__init__.py rename to src/articles/views/__init__.py diff --git a/articles/views/api.py b/src/articles/views/api.py similarity index 100% rename from articles/views/api.py rename to src/articles/views/api.py diff --git a/articles/views/feeds.py b/src/articles/views/feeds.py similarity index 100% rename from articles/views/feeds.py rename to src/articles/views/feeds.py diff --git a/articles/views/html.py b/src/articles/views/html.py similarity index 100% rename from articles/views/html.py rename to src/articles/views/html.py diff --git a/attachments/__init__.py b/src/attachments/__init__.py similarity index 100% rename from attachments/__init__.py rename to src/attachments/__init__.py diff --git a/attachments/admin.py b/src/attachments/admin.py similarity index 100% rename from attachments/admin.py rename to src/attachments/admin.py diff --git a/attachments/apps.py b/src/attachments/apps.py similarity index 100% rename from attachments/apps.py rename to src/attachments/apps.py diff --git a/attachments/management/commands/reprocess_all_attachments.py b/src/attachments/management/commands/reprocess_all_attachments.py similarity index 100% rename from attachments/management/commands/reprocess_all_attachments.py rename to src/attachments/management/commands/reprocess_all_attachments.py diff --git a/attachments/migrations/0001_initial.py b/src/attachments/migrations/0001_initial.py similarity index 100% rename from attachments/migrations/0001_initial.py rename to src/attachments/migrations/0001_initial.py diff --git a/attachments/migrations/0002_auto_20200826_1814.py b/src/attachments/migrations/0002_auto_20200826_1814.py similarity index 100% rename from attachments/migrations/0002_auto_20200826_1814.py rename to src/attachments/migrations/0002_auto_20200826_1814.py diff --git a/attachments/migrations/0003_auto_20200826_1843.py b/src/attachments/migrations/0003_auto_20200826_1843.py similarity index 100% rename from attachments/migrations/0003_auto_20200826_1843.py rename to src/attachments/migrations/0003_auto_20200826_1843.py diff --git a/attachments/migrations/0004_auto_20200903_2116.py b/src/attachments/migrations/0004_auto_20200903_2116.py similarity index 100% rename from attachments/migrations/0004_auto_20200903_2116.py rename to src/attachments/migrations/0004_auto_20200903_2116.py diff --git a/attachments/migrations/0005_attachment_open_graph_image.py b/src/attachments/migrations/0005_attachment_open_graph_image.py similarity index 100% rename from attachments/migrations/0005_attachment_open_graph_image.py rename to src/attachments/migrations/0005_attachment_open_graph_image.py diff --git a/attachments/migrations/0006_auto_20201128_2022.py b/src/attachments/migrations/0006_auto_20201128_2022.py similarity index 100% rename from attachments/migrations/0006_auto_20201128_2022.py rename to src/attachments/migrations/0006_auto_20201128_2022.py diff --git a/attachments/migrations/0007_auto_20201201_1917.py b/src/attachments/migrations/0007_auto_20201201_1917.py similarity index 100% rename from attachments/migrations/0007_auto_20201201_1917.py rename to src/attachments/migrations/0007_auto_20201201_1917.py diff --git a/attachments/migrations/__init__.py b/src/attachments/migrations/__init__.py similarity index 100% rename from attachments/migrations/__init__.py rename to src/attachments/migrations/__init__.py diff --git a/attachments/models.py b/src/attachments/models.py similarity index 100% rename from attachments/models.py rename to src/attachments/models.py diff --git a/attachments/static/attachments/js/copy_url.js b/src/attachments/static/attachments/js/copy_url.js similarity index 100% rename from attachments/static/attachments/js/copy_url.js rename to src/attachments/static/attachments/js/copy_url.js diff --git a/attachments/tests/__init__.py b/src/attachments/tests/__init__.py similarity index 100% rename from attachments/tests/__init__.py rename to src/attachments/tests/__init__.py diff --git a/attachments/tests/cassettes/test_models/test_attachment_is_processed_by_shortpixel.yaml b/src/attachments/tests/cassettes/test_models/test_attachment_is_processed_by_shortpixel.yaml similarity index 100% rename from attachments/tests/cassettes/test_models/test_attachment_is_processed_by_shortpixel.yaml rename to src/attachments/tests/cassettes/test_models/test_attachment_is_processed_by_shortpixel.yaml diff --git a/attachments/tests/conftest.py b/src/attachments/tests/conftest.py similarity index 100% rename from attachments/tests/conftest.py rename to src/attachments/tests/conftest.py diff --git a/attachments/tests/resources/image.png b/src/attachments/tests/resources/image.png similarity index 100% rename from attachments/tests/resources/image.png rename to src/attachments/tests/resources/image.png diff --git a/attachments/tests/test_models.py b/src/attachments/tests/test_models.py similarity index 100% rename from attachments/tests/test_models.py rename to src/attachments/tests/test_models.py diff --git a/blog/__init__.py b/src/blog/__init__.py similarity index 100% rename from blog/__init__.py rename to src/blog/__init__.py diff --git a/blog/asgi.py b/src/blog/asgi.py similarity index 100% rename from blog/asgi.py rename to src/blog/asgi.py diff --git a/blog/settings.py b/src/blog/settings.py similarity index 100% rename from blog/settings.py rename to src/blog/settings.py diff --git a/blog/templates/admin/base_site.html b/src/blog/templates/admin/base_site.html similarity index 100% rename from blog/templates/admin/base_site.html rename to src/blog/templates/admin/base_site.html diff --git a/blog/templates/blog/robots.txt b/src/blog/templates/blog/robots.txt similarity index 100% rename from blog/templates/blog/robots.txt rename to src/blog/templates/blog/robots.txt diff --git a/blog/tests/__init__.py b/src/blog/tests/__init__.py similarity index 100% rename from blog/tests/__init__.py rename to src/blog/tests/__init__.py diff --git a/blog/tests/test_robots.py b/src/blog/tests/test_robots.py similarity index 100% rename from blog/tests/test_robots.py rename to src/blog/tests/test_robots.py diff --git a/blog/urls.py b/src/blog/urls.py similarity index 100% rename from blog/urls.py rename to src/blog/urls.py diff --git a/blog/wsgi.py b/src/blog/wsgi.py similarity index 100% rename from blog/wsgi.py rename to src/blog/wsgi.py diff --git a/manage.py b/src/manage.py similarity index 100% rename from manage.py rename to src/manage.py diff --git a/tasks.py b/tasks.py index bf1a303..a82c890 100644 --- a/tasks.py +++ b/tasks.py @@ -3,17 +3,18 @@ from pathlib import Path from invoke import task BASE_DIR = Path(__file__).parent.resolve(strict=True) +SRC_DIR = BASE_DIR / "src" @task def test(ctx): - with ctx.cd(BASE_DIR): + with ctx.cd(SRC_DIR): ctx.run("pytest", pty=True, echo=True) @task def test_cov(ctx): - with ctx.cd(BASE_DIR): + with ctx.cd(SRC_DIR): ctx.run( "pytest --cov=. --cov-report term-missing:skip-covered", pty=True, @@ -22,9 +23,14 @@ def test_cov(ctx): @task -def publish(ctx): +def build(ctx): with ctx.cd(BASE_DIR): ctx.run("docker-compose build django", pty=True, echo=True) + + +@task +def publish(ctx): + with ctx.cd(BASE_DIR): ctx.run("docker-compose push django", pty=True, echo=True)