Skip to content

Commit 614b592

Browse files
committed
Initial Project
0 parents  commit 614b592

File tree

141 files changed

+5261
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+5261
-0
lines changed

.devcontainer/bashrc.override.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
#
3+
# .bashrc.override.sh
4+
#
5+
6+
# persistent bash history
7+
HISTFILE=~/.bash_history
8+
PROMPT_COMMAND="history -a; $PROMPT_COMMAND"
9+
10+
# set some django env vars
11+
source /entrypoint
12+
13+
# restore default shell options
14+
set +o errexit
15+
set +o pipefail
16+
set +o nounset
17+
18+
# start ssh-agent
19+
# https://code.visualstudio.com/docs/remote/troubleshooting
20+
eval "$(ssh-agent -s)"

.devcontainer/devcontainer.json

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
// For format details, see https://containers.dev/implementors/json_reference/
2+
{
3+
"name": "pi23_gswdt_dev",
4+
"dockerComposeFile": [
5+
"../local.yml"
6+
],
7+
"init": true,
8+
"mounts": [
9+
{
10+
"source": "./.devcontainer/bash_history",
11+
"target": "/home/dev-user/.bash_history",
12+
"type": "bind"
13+
},
14+
{
15+
"source": "/tmp",
16+
"target": "/tmp",
17+
"type": "bind"
18+
},
19+
{
20+
"source": "~/.ssh",
21+
"target": "/home/dev-user/.ssh",
22+
"type": "bind"
23+
}
24+
],
25+
// Tells devcontainer.json supporting services / tools whether they should run
26+
// /bin/sh -c "while sleep 1000; do :; done" when starting the container instead of the container’s default command
27+
"overrideCommand": false,
28+
"service": "django",
29+
// "remoteEnv": {"PATH": "/home/dev-user/.local/bin:${containerEnv:PATH}"},
30+
"remoteUser": "dev-user",
31+
"workspaceFolder": "/app",
32+
// Set *default* container specific settings.json values on container create.
33+
"customizations": {
34+
"vscode": {
35+
"settings": {
36+
"editor.formatOnSave": true,
37+
"[python]": {
38+
"analysis.autoImportCompletions": true,
39+
"analysis.typeCheckingMode": "basic",
40+
"defaultInterpreterPath": "/usr/local/bin/python",
41+
"editor.codeActionsOnSave": {
42+
"source.organizeImports": true
43+
},
44+
// Uncomment when fixed
45+
// https://github.com/microsoft/vscode-remote-release/issues/8474
46+
// "editor.defaultFormatter": "ms-python.black-formatter",
47+
"formatting.blackPath": "/usr/local/bin/black",
48+
"formatting.provider": "black",
49+
"languageServer": "Pylance",
50+
// "linting.banditPath": "/usr/local/py-utils/bin/bandit",
51+
"linting.enabled": true,
52+
"linting.flake8Enabled": true,
53+
"linting.flake8Path": "/usr/local/bin/flake8",
54+
"linting.mypyEnabled": true,
55+
"linting.mypyPath": "/usr/local/bin/mypy",
56+
"linting.pycodestylePath": "/usr/local/bin/pycodestyle",
57+
// "linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
58+
"linting.pylintEnabled": true,
59+
"linting.pylintPath": "/usr/local/bin/pylint"
60+
}
61+
},
62+
// https://code.visualstudio.com/docs/remote/devcontainerjson-reference#_vs-code-specific-properties
63+
// Add the IDs of extensions you want installed when the container is created.
64+
"extensions": [
65+
"davidanson.vscode-markdownlint",
66+
"mrmlnc.vscode-duplicate",
67+
"visualstudioexptteam.vscodeintellicode",
68+
"visualstudioexptteam.intellicode-api-usage-examples",
69+
// python
70+
"ms-python.python",
71+
"ms-python.vscode-pylance",
72+
"ms-python.isort",
73+
"ms-python.black-formatter",
74+
// django
75+
"batisteo.vscode-django"
76+
]
77+
}
78+
},
79+
// Uncomment the next line if you want start specific services in your Docker Compose config.
80+
// "runServices": [],
81+
// Uncomment the next line if you want to keep your containers running after VS Code shuts down.
82+
// "shutdownAction": "none",
83+
// Uncomment the next line to run commands after the container is created.
84+
"postCreateCommand": "cat .devcontainer/bashrc.override.sh >> ~/.bashrc"
85+
}

.dockerignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.editorconfig
2+
.gitattributes
3+
.github
4+
.gitignore
5+
.gitlab-ci.yml
6+
.idea
7+
.pre-commit-config.yaml
8+
.readthedocs.yml
9+
.travis.yml
10+
venv
11+
.git
12+
.envs/

.editorconfig

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# http://editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.{py,rst,ini}]
12+
indent_style = space
13+
indent_size = 4
14+
15+
[*.{html,css,scss,json,yml,xml}]
16+
indent_style = space
17+
indent_size = 2
18+
19+
[*.md]
20+
trim_trailing_whitespace = false
21+
22+
[Makefile]
23+
indent_style = tab
24+
25+
[default.conf]
26+
indent_style = space
27+
indent_size = 2

.envs/.local/.django

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# General
2+
# ------------------------------------------------------------------------------
3+
USE_DOCKER=yes
4+
IPYTHONDIR=/app/.ipython
5+
# Redis
6+
# ------------------------------------------------------------------------------
7+
REDIS_URL=redis://redis:6379/0
8+
9+
# Celery
10+
# ------------------------------------------------------------------------------
11+
12+
# Flower
13+
CELERY_FLOWER_USER=debug
14+
CELERY_FLOWER_PASSWORD=debug

.envs/.local/.postgres

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# PostgreSQL
2+
# ------------------------------------------------------------------------------
3+
POSTGRES_HOST=postgres
4+
POSTGRES_PORT=5432
5+
POSTGRES_DB=pi23_gswdt
6+
POSTGRES_USER=debug
7+
POSTGRES_PASSWORD=debug

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto

.github/dependabot.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Config for Dependabot updates. See Documentation here:
2+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
3+
4+
version: 2
5+
updates:
6+
# Update GitHub actions in workflows
7+
- package-ecosystem: 'github-actions'
8+
directory: '/'
9+
# Every weekday
10+
schedule:
11+
interval: 'daily'
12+
13+
# Enable version updates for Docker
14+
# We need to specify each Dockerfile in a separate entry because Dependabot doesn't
15+
# support wildcards or recursively checking subdirectories. Check this issue for updates:
16+
# https://github.com/dependabot/dependabot-core/issues/2178
17+
- package-ecosystem: 'docker'
18+
# Look for a `Dockerfile` in the `compose/local/django` directory
19+
directory: 'compose/local/django/'
20+
# Every weekday
21+
schedule:
22+
interval: 'daily'
23+
# Ignore minor version updates (3.10 -> 3.11) but update patch versions
24+
ignore:
25+
- dependency-name: '*'
26+
update-types:
27+
- 'version-update:semver-major'
28+
- 'version-update:semver-minor'
29+
30+
- package-ecosystem: 'docker'
31+
# Look for a `Dockerfile` in the `compose/local/docs` directory
32+
directory: 'compose/local/docs/'
33+
# Every weekday
34+
schedule:
35+
interval: 'daily'
36+
# Ignore minor version updates (3.10 -> 3.11) but update patch versions
37+
ignore:
38+
- dependency-name: '*'
39+
update-types:
40+
- 'version-update:semver-major'
41+
- 'version-update:semver-minor'
42+
43+
- package-ecosystem: 'docker'
44+
# Look for a `Dockerfile` in the `compose/local/node` directory
45+
directory: 'compose/local/node/'
46+
# Every weekday
47+
schedule:
48+
interval: 'daily'
49+
50+
- package-ecosystem: 'docker'
51+
# Look for a `Dockerfile` in the `compose/production/aws` directory
52+
directory: 'compose/production/aws/'
53+
# Every weekday
54+
schedule:
55+
interval: 'daily'
56+
57+
- package-ecosystem: 'docker'
58+
# Look for a `Dockerfile` in the `compose/production/django` directory
59+
directory: 'compose/production/django/'
60+
# Every weekday
61+
schedule:
62+
interval: 'daily'
63+
# Ignore minor version updates (3.10 -> 3.11) but update patch versions
64+
ignore:
65+
- dependency-name: '*'
66+
update-types:
67+
- 'version-update:semver-major'
68+
- 'version-update:semver-minor'
69+
70+
- package-ecosystem: 'docker'
71+
# Look for a `Dockerfile` in the `compose/production/postgres` directory
72+
directory: 'compose/production/postgres/'
73+
# Every weekday
74+
schedule:
75+
interval: 'daily'
76+
77+
- package-ecosystem: 'docker'
78+
# Look for a `Dockerfile` in the `compose/production/traefik` directory
79+
directory: 'compose/production/traefik/'
80+
# Every weekday
81+
schedule:
82+
interval: 'daily'
83+
84+
# Enable version updates for Python/Pip - Production
85+
- package-ecosystem: 'pip'
86+
# Look for a `requirements.txt` in the `root` directory
87+
# also 'setup.cfg', 'runtime.txt' and 'requirements/*.txt'
88+
directory: '/'
89+
# Every weekday
90+
schedule:
91+
interval: 'daily'

.github/workflows/ci.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: CI
2+
3+
# Enable Buildkit and let compose use it to speed up image building
4+
env:
5+
DOCKER_BUILDKIT: 1
6+
COMPOSE_DOCKER_CLI_BUILD: 1
7+
8+
on:
9+
pull_request:
10+
branches: ['master', 'main']
11+
paths-ignore: ['docs/**']
12+
13+
push:
14+
branches: ['master', 'main']
15+
paths-ignore: ['docs/**']
16+
17+
concurrency:
18+
group: ${{ github.head_ref || github.run_id }}
19+
cancel-in-progress: true
20+
21+
jobs:
22+
linter:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout Code Repository
26+
uses: actions/checkout@v4
27+
28+
- name: Set up Python
29+
uses: actions/setup-python@v4
30+
with:
31+
python-version: '3.11'
32+
# Consider using pre-commit.ci for open source project
33+
- name: Run pre-commit
34+
uses: pre-commit/action@v3.0.0
35+
36+
# With no caching at all the entire ci process takes 4m 30s to complete!
37+
pytest:
38+
runs-on: ubuntu-latest
39+
40+
steps:
41+
- name: Checkout Code Repository
42+
uses: actions/checkout@v4
43+
44+
- name: Build the Stack
45+
run: docker compose -f local.yml build
46+
47+
- name: Run DB Migrations
48+
run: docker compose -f local.yml run --rm django python manage.py migrate
49+
50+
- name: Run Django Tests
51+
run: docker compose -f local.yml run django pytest
52+
53+
- name: Tear down the Stack
54+
run: docker compose -f local.yml down

0 commit comments

Comments
 (0)