Skip to content

Commit

Permalink
Merge pull request #63 from PythonBulawayo/develop
Browse files Browse the repository at this point in the history
Update main with latest POC changes
  • Loading branch information
mpumzee authored Oct 24, 2024
2 parents 2985017 + 16ffbb1 commit ea11090
Show file tree
Hide file tree
Showing 104 changed files with 12,379 additions and 8,340 deletions.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.git/
.idea/
.vscode/
.gitignore
.venv/
20 changes: 20 additions & 0 deletions .flake8
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
36 changes: 36 additions & 0 deletions .github/workflows/backend_lint.yml
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 .
21 changes: 21 additions & 0 deletions .github/workflows/deploy.yml
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
41 changes: 41 additions & 0 deletions .github/workflows/front_end_eslint.yml
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

26 changes: 26 additions & 0 deletions .gitpod.yml
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
21 changes: 21 additions & 0 deletions LICENSE.md
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.
Loading

0 comments on commit ea11090

Please sign in to comment.