-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from SumoLogic/ssong-SUMO-76740-metadata
Ssong sumo 76740 metadata
- Loading branch information
Showing
8 changed files
with
249 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Guide for developers | ||
This project is a plugin for the docker engine, which delivers logs to Sumo Logic by pushing log messages through an HTTP source. | ||
This is the guide for developers who want build and extend the plugin. If you just want use this plugin in your docker environment, please refer to the [readme file](README.md). | ||
|
||
## Prerequisite | ||
* [Download](https://www.docker.com/get-docker) and install latest docker engine | ||
* [Download](https://golang.org/dl/) and install latest Go language distribution | ||
* Clone/Download this repository to a local directory, and | ||
* Get all dependencies with | ||
```bash | ||
$ go get -d ./... | ||
``` | ||
|
||
## Build and install plugin to docker | ||
In bash, run: | ||
```bash | ||
$ sudo bash ./plugin_install.sh | ||
``` | ||
If everything goes fine, you can verify that the plugin is correctly installed with: | ||
```bash | ||
$ docker plugin ls | ||
ID NAME DESCRIPTION ENABLED | ||
2dcbb3a32956 sumologic:latest Sumo Logic logging driver true | ||
``` | ||
|
||
## Uninstall and cleanup the plugin | ||
In bash, run: | ||
```bash | ||
$ sudo bash ./plugin_uninstall.sh | ||
``` | ||
|
||
## Run sanity test | ||
* Make sure the plugin is installed and enabled | ||
* In bash, run: | ||
```bash | ||
$ docker run --log-driver=sumologic --log-opt sumo-url=<url> -i -t ubuntu bash | ||
``` | ||
This will create a bash session in a docker container and send all console contents to a Sumo Logic HTTP source as log lines | ||
|
||
## Run unit test | ||
The unit test is written in `XXX_test.go` which `XXX` is the module to be tested. You can launch all unit tests with: | ||
```bash | ||
$ go test -v | ||
``` | ||
The unit test do not require docker environment to run. For details about unit test or test framework in Go language, click [here](https://golang.org/pkg/testing/). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.