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 app due to the consumption of the chroming service as well as setting up your global/app navigation through the API.
- Make sure you have
Node.js
andnpm
installed - Run script to patch your
/etc/hosts
- Make sure you are using Red Hat proxy
- Clone this repository
- Run
npm install
to install dependencies
- Run
npm run start:proxy
to start chrome proxy and webpack bundler which serves the files with webpack dev server - App will be running at
https://stage.foo.redhat.com:1337/insights/drift/
npm run test
will run all testsnpm run lint
will run linter
npm run test -- -u
Ensure the following entry is in your /etc/hosts
file:
127.0.0.1 prod.foo.redhat.com
127.0.0.1 stage.foo.redhat.com
127.0.0.1 qa.foo.redhat.com
127.0.0.1 ci.foo.redhat.com
OBS: First go through the steps in drift-dev-setup.
In terminal run:
npm run ephemeral
This will route requests to pods running in ephemeral cluster.
Note: If you see ℹ 「wdm」: Compiled successfully.
, you are in good shape.
Finally, hit the following URL in your browser. If you are not logged in, you will be prompted to do so.
https://ci.foo.redhat.com:1337/insights/drift
In terminal run:
npm run stage
This will route requests to pods running in stage.
Note: If you see ℹ 「wdm」: Compiled successfully.
, you are in good shape.
Finally, hit the following URL in your browser. If you are not logged in, you will be prompted to do so.
https://stage.foo.redhat.com:1337/apps/drift/
OBS: First go through the steps in drift-dev-setup.
And have backend services running locally with sh run_app_locally
In terminal run:
npm run local
This will route requests to services running locally.
Finally, hit the following URL in your browser. If you are not logged in, you will be prompted to do so.
https://ci.foo.redhat.com:1337/insights/drift
If you want to test Drift with another application deployed locally, you can utilize LOCAL_APPS
environment variable and deploy the needed application on separate ports. To learn more about the variable, see https://github.com/RedHatInsights/frontend-components/tree/master/packages/config#running-multiple-local-frontend-applications.
We'll take for example insights-inventory-frontend.
Open new terminal, navigate to Inventory repository, and run it on a separate port without proxy:
npm run start -- --port=8003
In a separate terminal, run Drift with proxy enabled and list Inventory:
LOCAL_APPS=inventory:8003~http npm run start:proxy
If you are updating the drift-frontend app after a long period of time away, your node_modules folder may not be up to date with the packages outlined in the package.json
file. The easiest way to update this quickly and efficiently is to fun the following commands in a terminal window.
cd drift-frontend
rm -rf node_modules
npm i
After the packages are installed, you should be able to run npm run start
in the same terminal to get the app up and running.
- Make sure that you have SonarQube scanner installed.
- Duplicate the
sonar-scanner.properties.sample
config file.
cp sonar-scanner.properties.sample sonar-scanner.properties
- Update
sonar.host.url
,sonar.login
insonar-scanner.properties
. - Run the following command
java -jar /path/to/sonar-scanner-cli-4.6.0.2311.jar -D project.settings=sonar-scanner.properties
- Review the results in your SonarQube web instance.