2020-12-31 01:39:32 +00:00
|
|
|
# RaSCSI Web
|
|
|
|
|
2021-05-23 15:55:24 +00:00
|
|
|
## Setup local dev env
|
2020-12-31 01:39:32 +00:00
|
|
|
|
2021-05-23 15:55:24 +00:00
|
|
|
```bash
|
|
|
|
# Make a virtual env named venv
|
|
|
|
$ python3 -m venv venv
|
|
|
|
# Use that virtual env in this shell
|
|
|
|
$ source venv/bin/activate
|
|
|
|
# Install requirements
|
|
|
|
$ pip install -r requirements.txt
|
|
|
|
# Use mocks and a temp dir - start the web server
|
|
|
|
$ BASE_DIR=/tmp/images/ PATH=$PATH:`pwd`/mock/bin/ python3 web.py
|
|
|
|
```
|
|
|
|
|
|
|
|
### Mocks for local development
|
|
|
|
|
2021-10-06 01:39:26 +00:00
|
|
|
You may edit the files under `mock/bin` to simulate Linux command responses.
|
|
|
|
TODO: rascsi-web uses protobuf commands to send and receive data from rascsi.
|
2021-11-07 00:25:02 +00:00
|
|
|
A separate mocking solution will be needed for this interface.
|
|
|
|
|
|
|
|
### Static analysis with pylint
|
|
|
|
|
|
|
|
It is recommended to run pylint against new code to protect against bugs
|
|
|
|
and keep the code readable and maintainable.
|
|
|
|
The local pylint configuration lives in .pylintrc
|
|
|
|
|
|
|
|
```
|
|
|
|
sudo apt install pylint3
|
|
|
|
pylint3 python_source_file.py
|
|
|
|
```
|
2020-12-31 01:39:32 +00:00
|
|
|
|
2021-05-23 15:55:24 +00:00
|
|
|
## Pushing to the Pi via git
|
|
|
|
|
|
|
|
Setup a bare repo on the rascsi
|
2020-12-31 01:39:32 +00:00
|
|
|
```
|
2021-05-23 15:55:24 +00:00
|
|
|
$ ssh pi@rascsi
|
|
|
|
$ mkdir /home/pi/dev.git && cd /home/pi/dev.git
|
|
|
|
$ git --bare init
|
|
|
|
Initialized empty Git repository in /home/pi/dev.git
|
2020-12-31 01:39:32 +00:00
|
|
|
```
|
|
|
|
|
2021-05-23 15:55:24 +00:00
|
|
|
Locally
|
|
|
|
```
|
|
|
|
$ cd ~/source/RASCSI
|
|
|
|
$ git remote add pi ssh://pi@rascsi/home/pi/dev.git
|
|
|
|
$ git push pi master
|
|
|
|
```
|