2016-07-25 03:30:45 +00:00
|
|
|
# Kolide
|
|
|
|
|
2016-08-01 23:44:08 +00:00
|
|
|
[![Build Status](https://drone.io/github.com/kolide/kolide-ose/status.png)](https://drone.io/github.com/kolide/kolide-ose/latest)
|
|
|
|
|
2016-07-25 03:30:45 +00:00
|
|
|
## Building
|
|
|
|
|
|
|
|
To build the code, run the following from the root of the repository:
|
|
|
|
|
|
|
|
```
|
2016-08-04 15:41:18 +00:00
|
|
|
go build -o kolide
|
2016-07-25 03:30:45 +00:00
|
|
|
```
|
|
|
|
|
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
|
|
|
|
|
|
|
```
|
|
|
|
go test
|
|
|
|
```
|
|
|
|
|
2016-08-04 15:41:18 +00:00
|
|
|
Or if you using the Docker development environment run:
|
|
|
|
|
|
|
|
```
|
|
|
|
docker-compose app exec go test
|
|
|
|
```
|
|
|
|
|
2016-07-25 03:30:45 +00:00
|
|
|
## Development Environment
|
|
|
|
|
2016-08-04 15:41:18 +00:00
|
|
|
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
|
|
|
Once completed, you can access the application at `https://<your-docker-ip>:8080`
|
|
|
|
where `your-docker-ip` is localhost in most native docker installations.
|
|
|
|
|
|
|
|
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-04 15:41:18 +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
|
|
|
|
|
|
|
```
|
|
|
|
docker-compose down
|
|
|
|
```
|
|
|
|
|
2016-08-04 15:41:18 +00:00
|
|
|
Once you `docker-compose up` and are running the databases, you can re-build
|
|
|
|
the code with:
|
|
|
|
|
|
|
|
```
|
|
|
|
docker-compose exec app go build -o kolide
|
|
|
|
```
|
|
|
|
|
|
|
|
and then run the following command to create the database tables:
|
|
|
|
|
|
|
|
```
|
|
|
|
docker-compose exec app ./kolide prepare-db
|
|
|
|
```
|
|
|
|
|
|
|
|
## Docker Deployment
|
|
|
|
This repository comes with a simple Dockerfile. You can use this to easily
|
|
|
|
deploy Kolide in any infrastructure context that can consume a docker image
|
|
|
|
(heroku, kubernetes, rancher, etc).
|
|
|
|
|
|
|
|
To build the image locally, run:
|
|
|
|
|
|
|
|
```
|
|
|
|
docker build --rm -t kolide .
|
|
|
|
```
|
|
|
|
|
|
|
|
To run the image locally, simply run:
|
2016-07-25 03:30:45 +00:00
|
|
|
|
|
|
|
```
|
2016-08-04 15:41:18 +00:00
|
|
|
docker run -t -p 8080:8080 kolide
|
2016-08-01 23:44:08 +00:00
|
|
|
```
|