-
Notifications
You must be signed in to change notification settings - Fork 390
How to build and contribute
If you wish to build from source or contribute follow the steps bellow.
Make sure you have installed the following packages:
The cloned repository has the following directory structure:
-
redisinsight/ui
- Contains the frontend code -
redisinsight/api
- Contains the backend code -
docs
- Contains the documentation -
scripts
- Build scripts and other build-related files -
configs
- Webpack configuration files and other build-related files -
tests
- Contains the e2e
Before development or build you have to install required dependencies
$ yarn install
$ yarn --cwd redisinsight/api/
Run yarn build:statics
or yarn build:statics:win
for Windows
After you have installed all dependencies you can package the app.
Run yarn package:prod
to package app for the local platform:
# Production
$ yarn package:prod
The packaged installer will become available in the folder ./release.
There are 2 ways to develop:
After you have installed all dependencies you can now run the app.
Run yarn start
to start an electron application that will watch and build for you.
# Development
$ yarn start
Run yarn --cwd redisinsight/api/ start:dev
to start a local API at localhost:5000
.
# Development
$ yarn --cwd redisinsight/api/ start:dev
While the API is running, open your browser and navigate to http://localhost:5000/api/docs. You should see the Swagger UI.
Run yarn start:web
to start a local server for UI.
# Development
$ yarn start:web
Web interface will be available at http://localhost:8080.
Now servers will watch for changes and automatically build for you.
To be used for development purposes only
There are 2 different docker images available:
- Image with API and UI
- Image with API only
docker build .
Image exposes 5000 port
API docs - /api/docs
Main UI - /
Example:
docker build -t redisinsight .
docker run -p 5000:5000 -d --cap-add ipc_lock redisinsight
Then API docs and main UI should be available on http://localhost:5000/api/docs and http://localhost:5000.
Image exposes 5000 port
API docs - /api/docs
Example:
docker build -f api.Dockerfile -t api.redisinsight .
docker run -p 5000:5000 -d --cap-add ipc_lock api.redisinsight
Then API docs and main UI should be available on http://localhost:5000/api/docs.
yarn test
# Plain tests
yarn --cwd redisinsight/api test
# Tests with coverage
yarn --cwd redisinsight/api test:cov
# Plain tests
yarn --cwd redisinsight/api test:api
# Tests with coverage
yarn --cwd redisinsight/api test:api:cov
NOTE: Using
yarn test:api*
scripts you should have redis server up and running.
By default tests will look onlocalhost:6379
without any auth.
To customize tests configs, you should run test with proper environment variables.
Example:
If you have redis server running on a different host or port somehost:7777
with default user pass somepass
You should run test commands with such environment variables
# Plain tests
TEST_REDIS_HOST=somehost \
TEST_REDIS_PORT=7777 \
TEST_REDIS_PASSWORD-somepass \
yarn --cwd redisinsight/api test:api
You can find all possible environment variable available in the constants.ts file
Here you should not care about tests and local redis database configuration
We will spin up server inside docker container and run tests over it
# run this this command
./redisinsight/api/test/test-runs/start-test-run.sh -r oss-st-6
- -r - is the Redis Test Environment name
We are supporting several test environments to run tests on various Redis databases:
- oss-st-5 - OSS Standalone v5
- oss-st-5-pass - OSS Standalone v5 with admin pass required
- oss-st-6 - OSS Standalone v6 and all modules
- oss-st-6-tls - OSS Standalone v6 with TLS enabled
- oss-st-6-tls-auth - OSS Standalone v6 with TLS auth required
- oss-clu - OSS Cluster
- oss-clu-tls - OSS Cluster with TLS enabled
- oss-sent - OSS Sentinel
- re-st - Redis Enterprise with Standalone inside
- re-clu - Redis Enterprise with Cluster inside
Install E2E tests deps
yarn --cwd tests/e2e
Run E2E tests
yarn --cwd tests/e2e test:chrome