-
Notifications
You must be signed in to change notification settings - Fork 27
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 #63 from PythonBulawayo/develop
Update main with latest POC changes
- Loading branch information
Showing
104 changed files
with
12,379 additions
and
8,340 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,5 @@ | ||
.git/ | ||
.idea/ | ||
.vscode/ | ||
.gitignore | ||
.venv/ |
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 @@ | ||
[flake8] | ||
max-line-length = 88 | ||
extend-ignore = E203 | ||
ignore = D203, F722 | ||
exclude = | ||
frontend/, | ||
.git, | ||
__pycache__, | ||
docs/source/conf.py, | ||
old, | ||
build, | ||
dist, | ||
venv, | ||
.venv, | ||
.env, | ||
migrations, | ||
addons, | ||
addons-dev, | ||
settings.py, | ||
max-complexity = 10 |
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,36 @@ | ||
name: Backend_Pylint_Lint | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
- develop | ||
paths: | ||
- 'backend/**' | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
paths: | ||
- 'backend/**' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.8", "3.9", "3.10"] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install flake8 | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install flake8 | ||
working-directory: backend | ||
- name: Running flake8 | ||
run: | | ||
flake8 . |
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,21 @@ | ||
name: Deploy Application | ||
on: | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup SSH Keys | ||
run: | | ||
mkdir -p ~/.ssh | ||
echo "${{ secrets.VPS_SSH_KEY }}" > ~/.ssh/id_rsa | ||
chmod 600 ~/.ssh/id_rsa | ||
ssh-keyscan -t rsa ${{ secrets.VPS_IP }} >> ~/.ssh/known_hosts | ||
- name: Deploy using Ansible | ||
run: ansible-playbook -i ansible/hosts --private-key ~/.ssh/id_rsa -u optimus ansible/deploy.yaml |
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,41 @@ | ||
name: Front-end Eslint | ||
|
||
on: | ||
push: | ||
branches: [ "main", "develop" ] | ||
paths: | ||
- 'frontend/**' | ||
pull_request: | ||
branches: [ "main", "develop" ] | ||
paths: | ||
- 'frontend/**' | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [18.x] | ||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'npm' | ||
cache-dependency-path: frontend/package-lock.json | ||
|
||
- name: Update npm | ||
working-directory: frontend | ||
run: npm install -g npm@latest | ||
- name: Install dependencies | ||
working-directory: frontend | ||
run : npm install | ||
- name: Lint code | ||
working-directory: frontend | ||
run: npm run lint | ||
|
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 @@ | ||
# Image of workspace. Learn more: https://www.gitpod.io/docs/configure/workspaces/workspace-image | ||
image: gitpod/workspace-full:latest | ||
|
||
# List the start up tasks. Learn more: https://www.gitpod.io/docs/configure/workspaces/tasks | ||
tasks: | ||
- name: Setup Backend | ||
before: cd backend | ||
command: python -m venv venv && source venv/bin/activate && pip install -r requirements.txt && python manage.py makemigrations && python manage.py migrate && python manage.py runserver | ||
- name: Create Superuser Account | ||
before: cd backend | ||
command: python manage.py createsuperuser | ||
- name: Setup Frontend | ||
before: cd frontend | ||
command: npm install && npm run dev | ||
|
||
# List the ports to expose. Learn more: https://www.gitpod.io/docs/configure/workspaces/ports | ||
ports: | ||
- name: Frontend | ||
description: Port 5173 for the frontend | ||
port: 5173 | ||
onOpen: open-browser | ||
- name: Open Backend | ||
description: Port 8000 for the frontend | ||
port: 8000 | ||
onOpen: open-preview | ||
# Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart |
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,21 @@ | ||
# MIT License | ||
|
||
Copyright (c) 2024 PythonBulawayo | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
Oops, something went wrong.