Skip to content

Development

The following are instructions for setting up your machine for Flipt development.

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 setup to download dependencies
  3. Run make test to execute the test suite
  4. Run make dev to build and run in development mode
  5. Run make help to see a full list of possible make commands

Go Modules

Flipt uses Go 1.12 with Go Modules enabled. To reliably build Flipt, make sure you clone it to a location outside of your $GOPATH or set the environment variable GO111MODULE=on. For more info see: https://github.com/golang/go/wiki/Modules#how-to-install-and-activate-module-support.

Vagrant

You can also easily get started with a development environment running in a VM using Vagrant and Virtual Box.

Once you have Vagrant and Virtual Box installed you can cd into either the build/dev/ubuntu or build/dev/centos directories and run vagrant up.

This will provision a VM that installs the necessary dev dependencies and runs the Flipt test suite.

Once the provisioning process is complete, run:

$ vagrant ssh
$ cd ~/app/flipt
$ make dev

This will run Flipt in development mode inside your VM.

Configuration

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

make dev

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:

  • flipt.pb.go
  • flipt.pb.gw.go

Updating assets

Running make assets will regenerate the embedded assets (ui, api documentation) so that the next time make dev is run they will be included.

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.