Skip to content

Latest commit

 

History

History
74 lines (43 loc) · 3.26 KB

DEVELOPMENT.md

File metadata and controls

74 lines (43 loc) · 3.26 KB

Development

The following are instructions for setting up your local machine for Flipt development. For info on using VSCode Remote Containers / GitHub Codespaces, see #remote containers below.

Requirements

Before starting, make sure you have the following installed:

Setup

  1. Clone this repo: git clone https://github.com/markphelps/flipt
  2. Run make bootstrap to install required development tools
  3. Run make test to execute the test suite
  4. Run make server to build and run the server locally
  5. Run cd ui && yarn run dev to build and run the ui dev server
  6. Run make help to see a full list of possible make commands

Go

Flipt is built with Go 1.16+. To reliably build Flipt, make sure you clone it to a location outside of your $GOPATH.

Configuration

Configuration for running when developing Flipt can be found at ./config/local.yml. To run Flipt with this configuration, run:

make server

Changes

Changing certain types of files such as the protobuf, ui or documentation files require re-building before they will be picked up in new versions of the binary.

Updating .proto Files

After changing flipt.proto, you'll need to run make proto. This will regenerate the following files:

  • rpc/flipt.pb.go
  • rpc/flipt.pb.gw.go

Updating assets

Running make assets will regenerate the embedded assets (ui, api documentation).

UI components

The UI is built using Yarn and webpack and is also statically compiled into the Flipt binary.

The ui/README.md has more information on how to build the UI and also how to run it locally during development.

Remote Containers

Flipt now supports VSCode Remote Containers/GitHub Codespaces.

These technologies allow you to quickly get setup with a Flipt development environment either locally or 'in the cloud'.

For VSCode Remote Containers (devcontainers), make sure you have Docker and the ms-vscode-remote.remote-containers extension installed. Then simply clone this repo, open it in VSCode and run the Remote-Containers: Open Folder in Container command in VSCode.

If you have access to GitHub Codespaces, simply open Flipt in a codespaces from the Code tab in the repo on GitHub.

Building/Running

Regardless of whether you are using Remote Containers or GitHub Codespaces, you'll need to run a couple tasks to successfully build/run Flipt in these environments.

Then run the Server/Client run command to start the server and client.

This should publish three ports 8080, 8081, 9000.

8081 is the UI dev port that runs the yarn dev server that you can open in your browser.