From 4f2c91d84b447e883a0cfcf46c63cbfc17d58a25 Mon Sep 17 00:00:00 2001 From: jtieri <37750742+jtieri@users.noreply.github.com> Date: Sun, 5 Sep 2021 19:22:17 -0500 Subject: [PATCH] init go mod & add ignore files --- .dockerignore | 1 + .gitignore | 3 ++- Makefile | 37 +++++++++++++++++++++++++++++++++++++ go.mod | 8 ++++++++ go.sum | 6 ++++++ 5 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 .dockerignore create mode 100644 Makefile create mode 100644 go.mod create mode 100644 go.sum 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=