Fleet is the lightweight, programmable telemetry platform for servers and workstations. Get comprehensive, customizable data from all your devices and operating systems — without the downtime risk.
Go to file
2016-08-10 08:31:27 -07:00
app React Base (#61) 2016-08-09 22:15:44 -07:00
config Fix certificate path in development config (#55) 2016-08-09 16:18:03 -07:00
errors Improve error handling throughout backend (#50) 2016-08-09 19:04:28 -07:00
frontend React Base (#61) 2016-08-09 22:15:44 -07:00
Godeps React Base (#61) 2016-08-09 22:15:44 -07:00
sessions Improve error handling throughout backend (#50) 2016-08-09 19:04:28 -07:00
tools README and workflow updates (#62) 2016-08-10 08:31:27 -07:00
.gitignore README and workflow updates (#62) 2016-08-10 08:31:27 -07:00
circle.yml README and workflow updates (#62) 2016-08-10 08:31:27 -07:00
docker-compose.yml Updating README and documentation to reflect local building and testing (#58) 2016-08-09 19:17:07 -07:00
kolide.go README and workflow updates (#62) 2016-08-10 08:31:27 -07:00
Makefile README and workflow updates (#62) 2016-08-10 08:31:27 -07:00
meta_test.go README and workflow updates (#62) 2016-08-10 08:31:27 -07:00
package.json React Base (#61) 2016-08-09 22:15:44 -07:00
README.md README and workflow updates (#62) 2016-08-10 08:31:27 -07:00

Kolide CircleCI

Contents

Development Environment

Installing dependencies

To setup a working local development environment, you must install the following minimum toolset:

Once you have those minimum requirements, to install build dependencies, run the following:

make deps

Building

To generate all necessary code (bundling JavaScript into Go, etc), run the following:

go generate

On UNIX (OS X, Linux, etc), run the following to compile the application:

go build -o kolide

On Windows, run the following to compile the application:

go build -o kolide.exe

Testing

To run the application's tests, run the following from the root of the repository:

go test

From the root, go test will run a test launcher that executes go test and go vet in the appropriate subpackages, etc. If you're working in a specific subpackage, it's likely that you'll just want to iteratively run go test in that subpackage directly until you are ready to run the full test suite.

Viewing test coverage

When you run go test from the root of the repository, test coverage reports are generated in every subpackage. For example, the sessions subpackage will have a coverage report generated in ./sessions/sessions.cover

To explore a test coverage report on a line-by-line basis in the browser, run the following:

# substitute ./errors/errors.cover, ./app/app.cover, etc
go tool cover -html=./sessions/sessions.cover

To view test a test coverage report in a terminal, run the following:

# substitute ./errors/errors.cover, app/app.cover, etc
go tool cover -func=./sessions/sessions.cover

Starting the local development environment

To set up a canonical development environment via docker, run the following from the root of the repository:

docker-compose up

This requires that you have docker installed. At this point in time, automatic configuration tools are not included with this project.

Setting up the database tables

Once you docker-compose up and are running the databases, you can build the code and run the following command to create the database tables:

kolide prepare-db

Running Kolide

Now you are prepared to run a Kolide development environment. Run the following:

kolide serve

If you're running the binary from the root of the repository, where it is built by default, then the binary will automatically use the provided example configuration file, which assumes that you are running docker locally, on localhost via a native engine.

You may have to edit the example configuration file to use the output of docker-machine ip instead of localhost if you're using Docker via Docker Toolbox.

Automatic recompilation

If you're editing mostly frontend JavaScript, you may want the Go binary to be automatically recompiled with a new JavaScript bundle and restarted whenever you save a JavaScript file. To do this, instead of running kolide serve, run the following:

make watch

This is only supported on OS X and Linux.

Stopping the local development environment

If you'd like to shut down the virtual infrastructure created by docker, run the following from the root of the repository:

docker-compose down