Skip to content

Latest commit

 

History

History
54 lines (36 loc) · 2.16 KB

HACKING.md

File metadata and controls

54 lines (36 loc) · 2.16 KB

Hacking

Requirements

Quick Start

git clone [email protected]:vmware-tanzu/octant.git
cd octant
go run build.go go-install      # install Go dependencies.
export NG_CLI_ANALYTICS=false   # if you want to disable Angular CLI analytics or
export NG_CLI_ANALYTICS=ci      # if you want to enable Angular CLI analytics
go run build.go ci-quick        # build UI, generate UI files, and create octant binary.
./build/octant                  # run the Octant binary you just built

Testing

We generally require tests be added for all but the most trivial of changes. You can run govet and the tests using the commands below:

go run build.go vet
go run build.go test

Developing

When making changes to the frontend it can be helpful to have those changes trigger rebuilding the UI. Octant provides a short cut using:

go run build.go serve

The serve command starts two processes. The first is an alias for npm run start and will listen for changes and rebuild the UI. The UI server will launch on http://localhost:4200.

The second, is an alias for go run ./cmd/octant/main.go but with useful environment variables already set, OCTANT_PROXY_FRONTEND which will reverse proxy to the Angular service and OCTANT_DISABLE_OPEN_BROWSER which prevents Octant from attempting to start the default system browser. The Octant server will launch on http://localhost:7777.

Before Your Pull Request

When you are ready to create your pull request, we recommend running go run build.go ci.

This command will run our linting tools and test suite as well as produce a release binary that you can use to do a final manual test of your changes.

Using Storybook

Octant has Storybook configured to aid with developing components for the frontend. To start Storybook, run

$ cd web
$ npm run storybook