forked from City-of-Helsinki/parkkihubi
-
Notifications
You must be signed in to change notification settings - Fork 3
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 #6 from City-of-Turku/server-main-to-master
Merge django upgrade to master.
- Loading branch information
Showing
46 changed files
with
1,124 additions
and
388 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,27 @@ | ||
{ | ||
"name": "ParkkiHubi", | ||
"dockerComposeFile": [ | ||
"../docker-compose.yml", | ||
"docker-compose.yml" | ||
], | ||
"service": "runserver", | ||
"workspaceFolder": "/home/bew/bew", | ||
"runServices": [ | ||
"runserver", | ||
"postgresql", | ||
"memcached" | ||
], | ||
"shutdownAction": "stopCompose", | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"ms-python.python", | ||
"donjayamanne.githistory", | ||
"eamodio.gitlens", | ||
"davidanson.vscode-markdownlint", | ||
"dakara.transformer" | ||
] | ||
} | ||
}, | ||
"postCreateCommand": "cp -n local_settings.py.tpl_dev local_settings.py" | ||
} |
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,5 @@ | ||
--- | ||
version: '3' | ||
services: | ||
runserver: | ||
command: /bin/sh -c "while sleep 1000; do :; done" |
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 |
---|---|---|
|
@@ -10,18 +10,18 @@ jobs: | |
tests: | ||
strategy: | ||
matrix: | ||
python: ["3.5", "3.6", "3.8"] | ||
runs-on: ubuntu-20.04 | ||
container: "python:${{matrix.python}}-slim-buster" | ||
python: ["3.10"] #3.10 | ||
runs-on: ubuntu-22.04 #ubuntu:jammy-20231004 | ||
# container: "python:${{matrix.python}}-slim-buster" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Update apt-get sources | ||
run: apt-get update | ||
run: sudo apt-get update | ||
|
||
- name: Install PostgreSQL, PostGIS and GDAL | ||
run: > | ||
apt-get install -y | ||
sudo apt-get install -y | ||
gdal-bin | ||
python3-gdal | ||
postgis | ||
|
@@ -32,14 +32,14 @@ jobs: | |
build-essential | ||
- name: Start PostgreSQL server | ||
run: /etc/init.d/postgresql start | ||
run: sudo /etc/init.d/postgresql start | ||
|
||
- name: Allow root to create PostgreSQL databases | ||
run: su - postgres -c "createuser --createdb root" | ||
- name: Allow runner to create PostgreSQL databases | ||
run: sudo su - postgres -c "createuser --createdb runner" | ||
|
||
- name: Create PostGIS extension | ||
run: > | ||
su - postgres | ||
sudo su - postgres | ||
-c "psql template1 -c 'create extension postgis'" | ||
- name: Install Tox and tox-gh-actions | ||
|
@@ -52,7 +52,7 @@ jobs: | |
uses: codecov/codecov-action@v3 | ||
|
||
test-dockerization: | ||
runs-on: ubuntu-22.04 | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
|
@@ -62,6 +62,9 @@ jobs: | |
- name: Build Docker image of the app | ||
run: docker-compose build | ||
|
||
- name: Copy default configuration as active | ||
run: cp -n local_settings.py.tpl_dev local_settings.py | ||
|
||
- name: Start the services with docker-compose up | ||
run: docker-compose up -d | ||
|
||
|
@@ -72,14 +75,14 @@ jobs: | |
strategy: | ||
matrix: | ||
toxenv: [style, requirements, sanitizer] | ||
runs-on: ubuntu-20.04 | ||
runs-on: ubuntu-22.04 #ubuntu:jammy-20231004 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup Python | ||
uses: actions/[email protected] | ||
with: | ||
python-version: "3.5" | ||
python-version: "3.10" #3.10 | ||
|
||
- name: Install GDAL | ||
run: sudo apt-get install -y gdal-bin | ||
|
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 |
---|---|---|
@@ -1,51 +1,86 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Python: Django runserver", | ||
"type": "python", | ||
"request": "launch", | ||
"program": "${workspaceFolder}/manage.py", | ||
"args": ["runserver"], | ||
"django": true, | ||
"justMyCode": false | ||
}, | ||
{ | ||
"name": "Python: Debug Tests", | ||
"type": "python", | ||
"request": "launch", | ||
"purpose": ["debug-test"], | ||
"justMyCode": false | ||
}, | ||
{ | ||
"name": "Python: Attach to docker container", | ||
"type": "python", | ||
"request": "attach", | ||
"connect": {"host": "localhost", "port": 5678}, | ||
"pathMappings": [ | ||
{ | ||
"localRoot": "${workspaceFolder}", | ||
"remoteRoot": "/app" | ||
} | ||
], | ||
"justMyCode": false | ||
}, | ||
{ | ||
"name": "Docker: Python - Django", | ||
"type": "docker", | ||
"request": "launch", | ||
"preLaunchTask": "docker-run: debug", | ||
"python": { | ||
"pathMappings": [ | ||
{ | ||
"localRoot": "${workspaceFolder}", | ||
"remoteRoot": "/app" | ||
} | ||
], | ||
"projectType": "django", | ||
"django": true, | ||
"justMyCode": false | ||
} | ||
} | ||
] | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Django: Runserver", | ||
"type": "python", | ||
"request": "launch", | ||
"program": "${workspaceFolder}/manage.py", | ||
"args": [ | ||
"runserver", | ||
"0.0.0.0:8000" | ||
], | ||
"django": true, | ||
"justMyCode": false, | ||
"subProcess": true | ||
}, | ||
{ | ||
"name": "Django: Runserver - nonthreading", | ||
"type": "python", | ||
"request": "launch", | ||
"program": "${workspaceFolder}/manage.py", | ||
"args": [ | ||
"runserver", | ||
"--nothreading", | ||
"0.0.0.0:8000" | ||
], | ||
"django": true, | ||
"justMyCode": false, | ||
"subProcess": true | ||
}, | ||
{ | ||
"name": "Django: Shell", | ||
"type": "python", | ||
"request": "launch", | ||
"program": "${workspaceFolder}/manage.py", | ||
"args": [ | ||
"shell" | ||
], | ||
"django": true, | ||
"justMyCode": false | ||
}, | ||
{ | ||
"name": "Django: Migrate", | ||
"type": "python", | ||
"request": "launch", | ||
"program": "${workspaceFolder}/manage.py", | ||
"args": [ | ||
"migrate" | ||
], | ||
"django": true, | ||
"justMyCode": false | ||
}, | ||
{ | ||
"name": "Django: Make migrations", | ||
"type": "python", | ||
"request": "launch", | ||
"program": "${workspaceFolder}/manage.py", | ||
"args": [ | ||
"makemigrations" | ||
], | ||
"django": true, | ||
"justMyCode": false | ||
}, | ||
{ | ||
"name": "Django: Collectstatic", | ||
"type": "python", | ||
"request": "launch", | ||
"program": "${workspaceFolder}/manage.py", | ||
"args": [ | ||
"collectstatic", | ||
"--no-input" | ||
], | ||
"django": true, | ||
"justMyCode": false | ||
}, | ||
{ | ||
"name": "Run pytest", | ||
"type": "python", | ||
"request": "launch", | ||
"module": "pytest", | ||
"args": [], | ||
"django": true, | ||
"justMyCode": false | ||
} | ||
] | ||
} |
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,10 +1,17 @@ | ||
{ | ||
"python.testing.pytestEnabled": true, | ||
"python.testing.cwd": "${workspaceFolder}", | ||
"python.testing.pytestPath": "${workspaceFolder}/run-pytest", | ||
"python.testing.pytestArgs": [ | ||
"-vv", | ||
// Uncomment --create-db to refresh test database (after model changes) | ||
// "--create-db", | ||
], | ||
"python.defaultInterpreterPath": "../.venv/bin/python3", | ||
"git.autofetch": true, | ||
"git.autoStash": true, | ||
"git.fetchOnPull": true, | ||
"editor.renderWhitespace": "all", | ||
"editor.renderControlCharacters": true, | ||
"files.trimTrailingWhitespace": true, | ||
"zenMode.hideLineNumbers": false, | ||
"zenMode.centerLayout": false, | ||
"zenMode.fullScreen": false, | ||
"gitlens.codeLens.enabled": false, | ||
"gitlens.currentLine.enabled": false, | ||
"[python]": { | ||
"editor.tabSize": 2 | ||
} | ||
} |
Oops, something went wrong.