diff --git a/.gitignore b/.gitignore index fa20c39..c14acf9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,16 +1,11 @@ -# Results -result.json -*.xml - # IDE config .idea/ .vscode/ # Deps -cpp/deps/jsoncpp/ -cpp/deps/mysql-connector/ -cpp/deployment/cameradar_*_Release_Linux.tar.gz +glide.lock +/vendor -# Test -test/cameradartest.conf.json -test/cameradar_*_Debug_Linux.tar.gz \ No newline at end of file +# Golang +/bin/* +/pkg/* diff --git a/Dockerfile b/Dockerfile index 216e6cc..927dac4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,19 +7,14 @@ WORKDIR /go/src/github.com/EtixLabs/cameradar/cameraccess RUN apk update && \ apk upgrade && \ apk add nmap nmap-nselibs nmap-scripts \ - curl-dev \ + curl curl-dev \ gcc \ libc-dev \ git \ pkgconfig -RUN go get github.com/andelf/go-curl -RUN go get github.com/pkg/errors -RUN go get gopkg.in/go-playground/validator.v9 -RUN go get github.com/jessevdk/go-flags -RUN go get github.com/fatih/color -RUN go get github.com/gernest/wow - +RUN curl https://glide.sh/get | sh +RUN glide install RUN go build -o cameraccess # Final stage diff --git a/README.md b/README.md index 943d37c..424a681 100644 --- a/README.md +++ b/README.md @@ -129,6 +129,27 @@ With the above result, the RTSP URL would be `rtsp://admin:12345@173.16.100.45:5 ## Contribution +### Build + +#### Docker build + +To build the docker image, simply run `docker build -t . cameradar` in the root of the project. + +Your image will be called `cameradar` and NOT `ullaakut/cameradar`. + +#### Go build + +To build the project without docker: + +1. install [glide](https://github.com/Masterminds/glide) + * OSX: `brew install glide` + * Linux: `curl https://glide.sh/get | sh` + * Windows: Download the binary package [here](https://github.com/Masterminds/glide/releases) +2. `glide install` +3. `go build -o cameradar cameraccess/main.go` + +The cameradar binary is now in the root of the directory. + See [the contribution document](/CONTRIBUTING.md) to get started. ## Frequently Asked Questions diff --git a/glide.yaml b/glide.yaml new file mode 100644 index 0000000..318be5d --- /dev/null +++ b/glide.yaml @@ -0,0 +1,23 @@ +package: github.com/EtixLabs/cameradar +import: +- package: github.com/andelf/go-curl +- package: github.com/fatih/color + version: ~1.5.0 +- package: github.com/gernest/wow + subpackages: + - spin +- package: github.com/jessevdk/go-flags + version: ~1.3.0 +- package: github.com/pkg/errors + version: ~0.8.0 +- package: gopkg.in/go-playground/validator.v9 + version: ~9.7.0 +- package: github.com/go-playground/universal-translator + version: ~0.16.0 +- package: github.com/go-playground/locales + version: ~0.11.1 +testImport: +- package: github.com/stretchr/testify + version: ~1.1.4 + subpackages: + - assert