44 lines
1.1 KiB
Markdown
44 lines
1.1 KiB
Markdown
# System deployment
|
|
|
|
___
|
|
|
|
## Prerequisites
|
|
|
|
## Client
|
|
|
|
## Database
|
|
|
|
## Backend / Flask app
|
|
|
|
In order to not have complicated and error-prone copying manoevers a direct deployment from the repo is used using git.
|
|
|
|
### File structure
|
|
|
|
### Steps
|
|
|
|
1) Created a ssh-key for the user that does the installation on the server following the Github [instructions](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent).
|
|
2) Deploy generated key to the Github user account.
|
|
3) In the shell, activate ssh-agent and add the key. For example:
|
|
|
|
```bash
|
|
eval ($ssh-agent)
|
|
ssh-add ~/.ssh/od_ed25519
|
|
```
|
|
|
|
4) Change to deployment folder
|
|
|
|
```bash
|
|
cd /var/www/brecal_test
|
|
```
|
|
|
|
5) Perform sparse checkout on the Flask server subtree
|
|
|
|
```bash
|
|
git clone -n git@github.com:puls200/brecal.git <target_folder>
|
|
cd <target_folder>
|
|
git sparse-checkout set --no-cone src/server
|
|
git checkout
|
|
```
|
|
|
|
6) Database credentials are stored outside the web root, we are using /var/www/secure. Here the file ```connection_data.json``` is placed, a different named copy for each instance.
|