2016-08-09 03:42:24 +00:00
|
|
|
# Kolide [![CircleCI](https://circleci.com/gh/kolide/kolide-ose.svg?style=svg&circle-token=2573c239b7f18967040d2dec95ca5f71cfc90693)](https://circleci.com/gh/kolide/kolide-ose)
|
2016-08-01 23:44:08 +00:00
|
|
|
|
2016-07-25 03:30:45 +00:00
|
|
|
## Building
|
|
|
|
|
2016-08-10 05:15:44 +00:00
|
|
|
To build the code ensure you have `node` and `npm` installed run the
|
|
|
|
following from the root of the repository:
|
2016-07-25 03:30:45 +00:00
|
|
|
|
|
|
|
```
|
2016-08-10 05:15:44 +00:00
|
|
|
make
|
2016-07-25 03:30:45 +00:00
|
|
|
```
|
|
|
|
|
2016-08-10 05:15:44 +00:00
|
|
|
This will produce a binary called `kolide` in the root of the repo.
|
|
|
|
|
2016-08-01 23:32:20 +00:00
|
|
|
## Testing
|
|
|
|
|
2016-08-04 15:41:18 +00:00
|
|
|
To run the application's tests, run the following from the root of the
|
|
|
|
repository:
|
2016-08-01 23:32:20 +00:00
|
|
|
|
|
|
|
```
|
2016-08-10 02:17:07 +00:00
|
|
|
go vet ./... && go test -v ./...
|
2016-08-04 15:41:18 +00:00
|
|
|
```
|
|
|
|
|
2016-07-25 03:30:45 +00:00
|
|
|
## Development Environment
|
|
|
|
|
2016-08-10 05:15:44 +00:00
|
|
|
To setup a working local development environment run perform the following tasks:
|
|
|
|
|
|
|
|
* Install the following dependencies:
|
|
|
|
* [Docker & docker-compose](https://www.docker.com/products/overview#/install_the_platform)
|
|
|
|
* [go 1.6.x](https://golang.org/dl/)
|
|
|
|
* [nodejs 0.6.x](https://nodejs.org/en/download/current/) (and npm)
|
|
|
|
* A GNU compatible version of `make`
|
|
|
|
|
2016-08-10 05:21:58 +00:00
|
|
|
To install build dependencies, run the following:
|
|
|
|
|
|
|
|
```
|
|
|
|
make deps
|
|
|
|
```
|
|
|
|
|
2016-08-10 05:15:44 +00:00
|
|
|
Once those tools are installed, to set up a canonical development environment
|
|
|
|
via docker, run the following from the root of the repository:
|
2016-07-25 03:30:45 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
docker-compose up
|
|
|
|
```
|
|
|
|
|
2016-08-04 15:41:18 +00:00
|
|
|
This requires that you have docker installed. At this point in time,
|
|
|
|
automatic configuration tools are not included with this project.
|
2016-07-25 03:30:45 +00:00
|
|
|
|
2016-08-10 02:17:07 +00:00
|
|
|
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:
|
2016-08-04 15:41:18 +00:00
|
|
|
|
|
|
|
```
|
2016-08-10 02:17:07 +00:00
|
|
|
kolide prepare-db
|
2016-08-04 15:41:18 +00:00
|
|
|
```
|
|
|
|
|
2016-08-10 05:21:58 +00:00
|
|
|
After you build the code, you will be prepared to run a Kolide development
|
|
|
|
environment. Run the following:
|
2016-08-04 15:41:18 +00:00
|
|
|
|
|
|
|
```
|
2016-08-10 05:15:44 +00:00
|
|
|
make serve
|
2016-08-04 15:41:18 +00:00
|
|
|
```
|
|
|
|
|
2016-08-10 02:17:07 +00:00
|
|
|
You may have to edit the example configuration file to reflect `localhost` if
|
|
|
|
you're using Docker via a native docker engine or the output of
|
|
|
|
`docker-machine ip` if you're using Docker via `docker-toolbox`.
|
2016-08-04 15:41:18 +00:00
|
|
|
|
2016-08-10 02:17:07 +00:00
|
|
|
If you'd like to shut down the virtual infrastructure created by docker, run
|
|
|
|
the following from the root of the repository:
|
2016-07-25 03:30:45 +00:00
|
|
|
|
|
|
|
```
|
2016-08-10 02:17:07 +00:00
|
|
|
docker-compose down
|
2016-08-10 05:21:58 +00:00
|
|
|
```
|