Skip to content

kylape/insights-advisor-frontend

 
 

Repository files navigation

Insights Frontend (IF)

Build Status

Getting Started

There is a comprehensive quick start guide in the Storybook Documentation to setting up an Insights environment complete with:

Note: You will need to set up the Insights environment if you want to develop with the starter app due to the consumption of the chroming service as well as setting up your global/app navigation through the API.

Running locally

  1. npm install
  2. Have insights-proxy installed under PROXY_PATH and run the following command:
SPANDX_CONFIG="./profiles/local-frontend.js" bash $PROXY_PATH/scripts/run.sh
  1. npm start
  2. Checkout https://ci.foo.redhat.com:1337/insights/actions or https://prod.foo.redhat.com:1337/insights/actions depending on which api env your testing against

Testing

  • Travis is used to test the build for this code.
    • npm run test will run linters and tests

Deploying

The follow six branches are used by IF

  • prod-stable, prod-beta
  • ci-stable, ci-beta
  • qa-stable, qa-beta

A push or merge to master will automatically release to ci-beta and qa-beta The same will happen with action against master-stable, it will automatically release to ci-stable and qa-stable The prod-beta and prod-stable environments are updated by a deliberate push, (to each branch)

Nuggets and Tidbits

Running the Frontend against a particular Insights API branch

To start the Insights API against a particular branch in the insights-advisor-api git repo use the scripts/setup_insights_api.sh script, like so ...

[insights-advisor-frontend]$ ./scripts/setup_insights_api.sh
Usage: ./scripts/setup_insights_api.sh <branch>|-c
Start an Insights API environment (as a set of containers) from <branch> in the insights-advisor-api git repo

    <branch> : checkout <branch> and start the containers
    -c       : stop and cleanup the containers

[insights-advisor-frontend]$ ./scripts/setup_insights_api.sh stat_time_series
...
Running 'git clone --branch stat_time_series --single-branch git@github.com:RedHatInsights/insights-advisor-api.git /tmp/insights-advisor-api' ...
...

Finished setting up Insights API environment.
The Insights API is available at http://localhost:8000/api/insights/v1/
The Insights Frontend is available at https://ci.foo.redhat.com:1337

This starts a few containers related to the Insights API as well as an insights-proxy container.

Make sure to still perform steps 1, 3 and 4 above. That is, npm install and npm start. Running scripts/setup_insights_api.sh essentially replaces step 2.

Use docker commands, eg docker ps and docker logs -f <container_name> to access the logs from the API or other containers.

Start insights-proxy directly with docker

If you are running linux and have docker installed, you can skip the installation of the insights-proxy and run it directly with:

 docker run -v $PWD/config:/config --rm --net='host' -p1337:1337 -e PLATFORM=linux -ti docker.io/redhatinsights/insights-proxy

Running against a local API

Set apiHost in the ./profiles/local-frontend.js to http://127.0.0.1:8000

About

The Insights Frontend

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 85.7%
  • CSS 9.7%
  • Shell 2.1%
  • SCSS 1.7%
  • HTML 0.8%