Skip to content

Commit bb50b67

Browse files
authored
Move to railway (#46)
* lint code and railway deployment * add gh action * remove / * change env var * remove dep file * add dep file * add whitenoise and gunicorn * update dep file * update reqs and settings.py * add req file, railway crashes when using toml file * alluth https configuration
1 parent 29f6f85 commit bb50b67

Some content is hidden

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

65 files changed

+2668
-856
lines changed

.github/workflows/test.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# This is a basic workflow to help you get started with Actions
2+
name: Tests
3+
# Controls when the action will run.
4+
on:
5+
# Triggers the workflow on all branches
6+
push:
7+
branches: '*'
8+
pull_request:
9+
branches: '*'
10+
11+
# Allows you to run this workflow manually from the Actions tab
12+
workflow_dispatch:
13+
14+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
15+
jobs:
16+
# This workflow contains a single job called "build"
17+
tests:
18+
# The type of runner that the job will run on
19+
runs-on: ubuntu-latest
20+
defaults:
21+
run:
22+
shell: bash -l {0}
23+
24+
# Steps represent a sequence of tasks that will be executed as part of the job
25+
steps:
26+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
27+
- uses: actions/checkout@v2
28+
29+
30+
- name: Set up Python 🐍 ${{ matrix.python-version }}
31+
uses: actions/setup-python@v2
32+
with:
33+
python-version: ${{ matrix.python-version }}
34+
35+
# Debugging
36+
- name: Setup tmate session
37+
uses: mxschmitt/action-tmate@v3
38+
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
39+
40+
- name: Install dependencies
41+
run: |
42+
curl -sSL https://install.python-poetry.org | python3 -
43+
poetry export -f requirements.txt --output requirements.txt --without-hashes
44+
pip install -r requirements.txt
45+
46+
- name: Run Lint and Unit Tests ⚒
47+
env:
48+
SECRET_KEY: "RANDOM_KEY"
49+
run: |
50+
pre-commit run --all-files

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ coverage.xml
6161
# Django stuff:
6262
*.log
6363
local_settings.py
64+
db.sqlite3
65+
db.sqlite3-journal
6466

6567
# Flask stuff:
6668
instance/

.pre-commit-config.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
exclude: 'wip'
2+
repos:
3+
- repo: https://github.com/ambv/black
4+
rev: 22.3.0
5+
hooks:
6+
- id: black
7+
name: black-py
8+
- repo: https://github.com/asottile/pyupgrade
9+
rev: v2.32.0
10+
hooks:
11+
- id: pyupgrade
12+
name: pyupgrade-py

Procfile

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.md

Lines changed: 5 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -17,46 +17,19 @@ Environment Setup
1717

1818
`$ cd SIH-2020/`
1919

20-
If virtualenv is not installed [(What is virtualenv?)](https://www.youtube.com/watch?v=N5vscPTWKOk&t=313s):
20+
Install requirements from [poetry](https://python-poetry.org/docs/#installation) - `poetry install`
21+
- OR If you prefer the vanilla route using virtual env `poetry export -f requirements.txt --output requirements.txt --without-hashes`
2122

22-
`$ pip install virtualenv`
2323

24-
Create a virtual environment
24+
Activate the environment - `poetry shell`
2525

26-
`$ virtualenv venv`
27-
28-
Activate the environment everytime you open the project
29-
30-
`$ source venv/Scripts/activate`
31-
32-
`$ git checkout dev`
33-
34-
Install requirements
35-
36-
`$ pip install -r requirements.txt`
37-
38-
To run alpr, Install alpr for your OS from [here](https://github.com/openalpr/openalpr) using the docs, preferrably use Ubuntu, then put this file - `alpr/main.py` where alpr is installed and make sure the videos, runtime and config paths in the script point to the path in your system. Then run the script to see the Live Feed
39-
40-
`python3 main.py`
41-
42-
Add Google Map API Keys in these pages:
43-
44-
templates/userapp/add_charging_station.html
45-
templates/userapp/complaint_dashboard.html
46-
templates/userapp/consumer_charging_stations.html
47-
templates/userapp/routeyourway.html
26+
(Optional)To run alpr, Install alpr for your OS from [here](https://github.com/openalpr/openalpr) using the docs, preferrably use Ubuntu, then put this file - `alpr/main.py` where alpr is installed and make sure the videos, runtime and config paths in the script point to the path in your system. Then run the script to see the Live Feed
4827

4928
All Set!
5029

5130
`$ python manage.py runserver`
5231

5332
Before you do a git add/commit make sure to check the code base for coding style/programming errors
5433

55-
`$ flake8`
56-
57-
Fix it then stage changes!
58-
59-
To exit the environment
60-
61-
`$ deactivate `
34+
`pre-commit run --all-files`
6235

0 commit comments

Comments
 (0)