diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..567609b --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +build/ diff --git a/.gitignore b/.gitignore index 1cc8a94..e91c9f4 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,5 @@ *.out # GoLand project files etc. -.idea/* \ No newline at end of file +.idea/* +build/ \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..286dc55 --- /dev/null +++ b/Makefile @@ -0,0 +1,37 @@ +#VERSION := $(shell echo $(shell git describe --tags) | sed 's/^v//') + +all: install + +############################################################################### +# Build / Install +############################################################################### + +build: go.sum +ifeq ($(OS),Windows_NT) + @echo "building habbgo binary..." + @go build -mod=readonly $(BUILD_FLAGS) -o build/habbgo.exe ./habbgo +else + @echo "building habbgo binary..." + @go build -mod=readonly $(BUILD_FLAGS) -o build/habbgo ./habbgo +endif + +install: + @echo "installing habbgo binary..." + @go install -mod readonly $(BUILD_FLAGS) ./habbgo + +build-habbgo-docker: + docker build -t jtieri/habbgo:latest -f ./docker/habbgo/Dockerfile . + +clean: + rm -rf build + +############################################################################### +# Tests / CI +############################################################################### + +test: + @go test -mod readonly -v ./... + +run-docker: + docker build -t jtieri/habbgo:latest -f ./docker/habbgo/Dockerfile . + docker run jtieri/habbgo \ No newline at end of file diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..0588834 --- /dev/null +++ b/go.mod @@ -0,0 +1,8 @@ +module github.com/jtieri/HabbGo + +go 1.16 + +require ( + github.com/go-sql-driver/mysql v1.6.0 + gopkg.in/yaml.v2 v2.4.0 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..a49a515 --- /dev/null +++ b/go.sum @@ -0,0 +1,6 @@ +github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= +github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=