init go mod & add ignore files

This commit is contained in:
jtieri 2021-09-05 19:22:17 -05:00
parent 12ca90c707
commit 4f2c91d84b
5 changed files with 54 additions and 1 deletions

1
.dockerignore Normal file
View File

@ -0,0 +1 @@
build/

3
.gitignore vendored
View File

@ -12,4 +12,5 @@
*.out
# GoLand project files etc.
.idea/*
.idea/*
build/

37
Makefile Normal file
View File

@ -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

8
go.mod Normal file
View File

@ -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
)

6
go.sum Normal file
View File

@ -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=