-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
32 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,32 @@ | ||
# VERSION := $(shell cat ./VERSION) | ||
IMAGE_NAME := golang:latest | ||
|
||
all: install binaries | ||
|
||
install: | ||
go build . | ||
test: | ||
go test ./... -v | ||
|
||
image: | ||
docker build . -t bob | ||
|
||
binaries: | ||
gox -output="bin/{{.Dir}}_{{.OS}}_{{.Arch}}" -osarch="darwin/amd64 linux/386 linux/amd64" | ||
|
||
# vandocker: | ||
# docker build -f vandockerfile -t vandocker . | ||
|
||
runvandocker: | ||
docker run --rm -it -v /var/run/docker.sock:/tmp/thisisnotasocket.mock -v `pwd`:/app docker /bin/sh | ||
|
||
# run: | ||
# docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock bob /bin/bash | ||
|
||
run: | ||
docker run --rm -it -v `pwd`:/app -v /var/run/docker.sock:/var/meh bob /bin/bash | ||
|
||
runpriv: | ||
docker run --rm --cap-add SYS_PTRACE -it -v `pwd`:/app -v /var/run/docker.sock:/var/meh bob /bin/bash | ||
|
||
runpid: | ||
docker run -ti --rm --pids-limit="10" bob /bin/bash | ||
|
||
runclean: | ||
docker run -it bob /bin/bash | ||
runtest: | ||
docker run -it --rm -v `pwd`/bob:/bob -v /var/run/docker.sock:/var/meh bob /app/main -path=/ -cicd=true && echo $? | ||
# runtest2: | ||
# docker run -it --rm --entrypoint "/bin/sh" ubuntu:latest | ||
# runtest3: | ||
# docker run -it --rm -v /var/run/docker.sock:/var/meh --entrypoint "/bin/sh" ubuntu:latest | ||
# .PHONY: install test fmt release | ||
|
||
|
||
docker run --rm -it -v /var/run/docker.sock:/tmp/thisisnotasocket.mock -v `pw | ||
d`:/app -e DOCKER_HOST='/tmp/thisisnotasocket.mock' golang /bin/sh | ||
SHELL := /bin/bash | ||
DIR := $(shell pwd) | ||
BINARY_NAME := botb | ||
OUTPUTDIR := ${DIR}/bin | ||
|
||
.PHONY: all build-linux clean | ||
|
||
GOV111PREFIX := | ||
GOV111 := $(shell expr `go version | cut -f2 -d.` \>= 11) | ||
ifeq "$(GOV111)" "" | ||
GOV111PREFIX := env GO111MODULE=on | ||
else | ||
GOVERSION := $(shell expr `go version | cut -f2 -d.` \>= 11) | ||
ifeq "$(GOVERSION)" "" | ||
$(error must be running Go version 1.11 or newer, due to use of modules) | ||
endif | ||
endif | ||
|
||
all: clean build-linux | ||
|
||
clean: | ||
@echo ">> removing previous builds" | ||
@rm -rf $(OUTPUTDIR) | ||
|
||
$(GOPATH): | ||
GOPATH := $(HOME)/go | ||
|
||
build-linux: | ||
@echo ">> running check for unused/missing packages in go.mod" | ||
@go mod tidy | ||
@echo ">> building binary" | ||
$(GOV111PREFIX) GOOS=linux GOARCH=amd64 go build -o $(OUTPUTDIR)/$(BINARY_NAME)-linux-amd64 ./ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,23 @@ | ||
github.com/aws/aws-sdk-go v1.20.16 h1:Dq68fBH39XnSjjb2hX/iW6mui8JtXcVAuhRYGSRiisY= | ||
github.com/aws/aws-sdk-go v1.20.16/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= | ||
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= | ||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= | ||
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM= | ||
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= | ||
github.com/kr/pty v1.1.5 h1:hyz3dwM5QLc1Rfoz4FuWJQG5BN7tc6K1MndAUnGpQr4= | ||
github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= | ||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= | ||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= | ||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= | ||
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= | ||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= | ||
github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926 h1:G3dpKMzFDjgEh2q1Z7zUUtKa8ViPtH+ocF0bE0g00O8= | ||
github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= | ||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= | ||
golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8 h1:1wopBVtVdWnn03fZelqdXTqk7U7zPQCb+T4rbU9ZEoU= | ||
golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= | ||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ= | ||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= | ||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= | ||
golang.org/x/sys v0.0.0-20190412213103-97732733099d h1:+R4KGOnez64A81RvjARKc4UT5/tI9ujCIVX+P5KiHuI= | ||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= | ||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= | ||
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.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= | ||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= |