chore(vagrant): Adding development readme
Signed-off-by: rjshrjndrn <rjshrjndrn@gmail.com>
This commit is contained in:
parent
6b35a05e13
commit
2a8cb4afbc
4 changed files with 156 additions and 0 deletions
43
api/development.md
Normal file
43
api/development.md
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
### Prerequisites
|
||||
|
||||
- [Vagrant](../scripts/vagrant/README.md)
|
||||
- Python 3.9
|
||||
- Pipenv
|
||||
|
||||
### Development environment
|
||||
|
||||
```bash
|
||||
**FOSS:**
|
||||
cd openreplay/api
|
||||
# Make your own copy of .env file and edit it as you want
|
||||
cp .env.dev .env
|
||||
|
||||
# Create a .venv folder to contain all you dependencies
|
||||
mkdir .venv
|
||||
|
||||
# Installing dependencies (pipenv will detect the .venv folder and use it as a target)
|
||||
pipenv install -r requirements.txt [--skip-lock]
|
||||
|
||||
# Create a .venv folder to contain all you dependencies
|
||||
mkdir .venv
|
||||
|
||||
# Installing dependencies (pipenv will detect the .venv folder and use it as a target)
|
||||
pipenv install -r requirements.txt [--skip-lock]
|
||||
|
||||
# These commands must bu used everytime you make changes to FOSS.
|
||||
# To clean the unused files before getting new ones
|
||||
bash clean.sh
|
||||
# To copy commun files from FOSS
|
||||
bash prepare-dev.sh
|
||||
```
|
||||
|
||||
### Building and deploying locally
|
||||
|
||||
```bash
|
||||
cd openreplay-contributions
|
||||
vagrant ssh
|
||||
cd openreplay-dev/openreplay/scripts/helmcharts
|
||||
# For complete list of options
|
||||
# bash local_deploy.sh help
|
||||
bash local_deploy.sh api
|
||||
```
|
||||
21
backend/development.md
Normal file
21
backend/development.md
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
### Prerequisites
|
||||
|
||||
- [Vagrant](../scripts/vagrant/README.md)
|
||||
|
||||
### Development environment
|
||||
|
||||
```bash
|
||||
docker build -f Dockerfile.bundle .
|
||||
|
||||
```
|
||||
|
||||
### Building and deploying locally
|
||||
|
||||
```bash
|
||||
cd openreplay-contributions
|
||||
vagrant ssh
|
||||
cd openreplay-dev/openreplay/scripts/helmcharts
|
||||
# For complete list of options
|
||||
# bash local_deploy.sh help
|
||||
bash local_deploy.sh <worker name>
|
||||
```
|
||||
23
frontend/development.md
Normal file
23
frontend/development.md
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
### Prerequisites
|
||||
|
||||
- [Vagrant](../scripts/vagrant/README.md)
|
||||
- Node Version 17
|
||||
- npm
|
||||
|
||||
### Development environment
|
||||
|
||||
```bash
|
||||
cd openreplay/frontend
|
||||
# Change endpoints to local openreplay installation
|
||||
sed -i 's#PRODUCTION: true#PRODUCTION: false#g' env.js
|
||||
sed -i "s#API_EDP: .*#API_EDP: 'http://openreplay.local/api',#g" env.js
|
||||
sed -i "s#ASSETS_HOST: .*#ASSETS_HOST: 'http://openreplay.local/assets',#g" env.js
|
||||
|
||||
# Installing dependencies
|
||||
npm install
|
||||
|
||||
# Generating assets
|
||||
npm run gen:css-types
|
||||
npm run gen:icons
|
||||
npm run gen:colors
|
||||
```
|
||||
69
scripts/vagrant/README.md
Normal file
69
scripts/vagrant/README.md
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
<aside>
|
||||
💡 As of today, VirtualBox is not supported on Mac M1. You can try with VMWare as the Vagrant backend, but this has not been tested.
|
||||
</aside>
|
||||
|
||||
### Installation
|
||||
|
||||
- Vagrant: [https://www.vagrantup.com/downloads](https://www.vagrantup.com/downloads)
|
||||
- VirtualBox: [https://www.virtualbox.org/wiki/Downloads](https://www.virtualbox.org/wiki/Downloads)
|
||||
|
||||
### Configuration
|
||||
|
||||
```bash
|
||||
mkdir openreplay-contributions
|
||||
cd openreplay-contributions
|
||||
git clone https://github.com/openreplay/openreplay -b dev
|
||||
cp -rf openreplay/scripts/vagrant/ .
|
||||
vagrant up
|
||||
```
|
||||
|
||||
### To access OpenReplay instance
|
||||
|
||||
```bash
|
||||
Add ip address from about output to your local resolver
|
||||
|
||||
## Mac/Linux
|
||||
|
||||
Copy paste the command from the vagrant output
|
||||
|
||||
## Windows
|
||||
|
||||
Use the following instructions if you’re running Windows 10 or Windows 8:
|
||||
Press the Windows key.
|
||||
Type Notepad in the search field.
|
||||
In the search results, right-click Notepad and select Run as administrator.
|
||||
From Notepad, open the following file:
|
||||
c:\Windows\System32\Drivers\etc\hosts
|
||||
add the below line in the hosts file
|
||||
<ip address from vagrant output> openreplay.local
|
||||
Select File > Save to save your changes.
|
||||
|
||||
**Open browser**
|
||||
http://openreplay.local
|
||||
```
|
||||
|
||||
### To start developing
|
||||
|
||||
- [Frontend](../../frontend/development.md)
|
||||
- [API](../../api/development.md)
|
||||
- [Backend](../../backend/development.md)
|
||||
|
||||
### Notes
|
||||
|
||||
It’ll be a good practice to take a snapshot once the initial setup is complete, so that if something is not working as expected, you can always fall back to a stable known version.
|
||||
```bash
|
||||
cd openreplay-dev
|
||||
vagrant snapshot save <openreplay-version-base>
|
||||
# For example
|
||||
vagrant snapshot save openreplay-160-base
|
||||
```
|
||||
|
||||
```bash
|
||||
# To restore the snapshot
|
||||
cd openreplay-dev
|
||||
vagrant snapshot restore openreplay-160-base
|
||||
```
|
||||
|
||||
<aside>
|
||||
💡 If the base VM is deleted, the snapshot won’t be available.
|
||||
</aside>
|
||||
Loading…
Add table
Reference in a new issue