forked from odino/docsql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
21 lines (20 loc) · 1.06 KB
/
Makefile
File metadata and controls
21 lines (20 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
DOCKER_IMAGE_NAME=docsql
ARGS := $(if $(ARGS),$(ARGS),go run main.go)
build_docker:
docker build -t ${DOCKER_IMAGE_NAME} .
test:
docker run -ti --net host -e CONNECTION="root:@tcp(localhost:3308)/test?charset=utf8&allowAllFiles=true" -v $$(pwd):/go/src/github.com/odino/docsql ${DOCKER_IMAGE_NAME} ${ARGS}
build: build_simple
docker run -ti --net host -v $$(pwd):/go/src/github.com/odino/docsql ${DOCKER_IMAGE_NAME} gox -output="builds/{{.Dir}}_{{.OS}}_{{.Arch}}_$$(./builds/simple version | awk '{print $$2}')"
sudo chown $$USER:$$USER builds
sudo chown $$USER:$$USER builds/*
release: build
ls -la builds | grep -v ".tar.gz" | grep docsql | awk '{print "tar -czf builds/" $$9 ".tar.gz builds/" $$9}' | bash
ls -la builds | grep -v ".tar.gz" | grep docsql | awk '{print "rm builds/" $$9}' | bash
ls -la builds
build_simple:
docker run -ti --net host -v $$(pwd):/go/src/github.com/odino/docsql ${DOCKER_IMAGE_NAME} go build -o builds/simple main.go
clean:
rm -rf builds/*
fmt:
docker run -ti -v $$(pwd):/go/src/github.com/odino/docsql ${DOCKER_IMAGE_NAME} go fmt ./...