Skip to content

Commit

Permalink
update makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelmota committed Feb 16, 2019
1 parent 26248f1 commit d805278
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 9 deletions.
47 changes: 40 additions & 7 deletions Makefile
@@ -1,15 +1,20 @@
.PHONY: test
test:
go test -v ./... && echo 'ALL PASS'
all: help

PKGS := $(shell go list ./... | grep -v /vendor)

PROJECTNAME=$(shell basename "$(PWD)")

## install: Install missing dependencies. Runs `go get` internally.
install:
@go get $(get)

.PHONY: test/install-deps
test/install-deps:
set -x
# install Docker
VER="18.03.1-ce"
curl -L -o /tmp/docker-$VER.tgz https://download.docker.com/linux/static/stable/x86_64/docker-$VER.tgz
tar -xz -C /tmp -f /tmp/docker-$VER.tgz
curl -L -o /tmp/docker-$$VER.tgz https://download.docker.com/linux/static/stable/x86_64/docker-$$VER.tgz
tar -xz -C /tmp -f /tmp/docker-$$VER.tgz
sudo mv /tmp/docker/* /usr/bin
# install IPFS
wget https://dist.ipfs.io/go-ipfs/v0.4.14/go-ipfs_v0.4.14_linux-amd64.tar.gz -O /tmp/go-ipfs.tar.gz
Expand All @@ -23,8 +28,36 @@ test/install-deps:
ipfs config Addresses.Gateway /ip4/0.0.0.0/tcp/9001
ipfs daemon &

## test: Runs `go test` on project test files.
.PHONY: test
test:
go test -v $(PKGS) && echo 'ALL PASS'

## clean: Clean build files. Runs `go clean` internally.
.PHONY: clean
clean:
rm -f docker/*.tar
rm ipfs/tmp_data
@go clean
@rm -f docker/*.tar
@rm ipfs/tmp_data

$(GOMETALINTER):
go get -u github.com/alecthomas/gometalinter
gometalinter --install

## lint: Lints project files, go gets gometalinter if missing. Runs `gometalinter` on project files.
.PHONY: lint
lint: $(GOMETALINTER)
gometalinter ./... exclude=gosec --vendor

## build: Builds project into an executable binary.
.PHONY: build
build:
go build -o bin/ipdr cmd/ipdr/main.go

.PHONY: help
help: Makefile
@echo
@echo " Choose a make command to run in "$(PROJECTNAME)":"
@echo
@sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /'
@echo
6 changes: 6 additions & 0 deletions README.md
Expand Up @@ -17,6 +17,12 @@

**WIP**

## Install

```bash
go install github.com/miguelmota/ipdr/cmd/ipdr
```

## Getting started

TODO
Expand Down
Binary file added bin/ipdr
Binary file not shown.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions go.sum
Expand Up @@ -36,7 +36,7 @@ github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BU
github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/docker v0.7.3-0.20190214224811-fcb286895b70 h1:YuIVsztcfAgDzsq3bOhKYmp0TpuRE5/gHzErhOQyKmo=
github.com/docker/docker v0.7.3-0.20190214224811-fcb286895b70/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v1.13.1 h1:5VBhsO6ckUxB0A8CE5LlUJdXzik9cbEbBTQ/ggeml7M=
github.com/docker/docker v1.13.1 h1:IkZjBSIc8hBjLpqeAbeE5mca5mNgeatLHBy3GO78BWo=
github.com/docker/docker v1.13.1/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/go-connections v0.3.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec=
github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ=
Expand Down Expand Up @@ -196,7 +196,7 @@ github.com/multiformats/go-multiaddr-net v1.7.1 h1:1k758hMzdVA8+qE2z705TNWeemoi+
github.com/multiformats/go-multiaddr-net v1.7.1/go.mod h1:AO4WqKzxLt+paJ0N0kufj6teQ2R6fZbnItDvGTwilmk=
github.com/multiformats/go-multibase v0.3.0/go.mod h1:RUrDbdRB1mQ1K/3PAh7h7+6NliRK10PA5joM8V0IYLI=
github.com/multiformats/go-multicodec v0.1.6/go.mod h1:lliaRHbcG8q33yf4Ot9BGD7JqR/Za9HE7HTyVyKwrUQ=
github.com/multiformats/go-multihash v1.0.8 h1:pyowaBSivNxBr137ZjYkr0q4o41MKSJVPKuO7F7AAfY=
github.com/multiformats/go-multihash v1.0.8 h1:v/1HVWH2gq7IZGnFXrTsjoG2I5XIsU5gXiGH5SH915k=
github.com/multiformats/go-multihash v1.0.8/go.mod h1:sT17phG+xVgnrZc8ht/ZoCIV0sKRwvmZkXk46UfSxM4=
github.com/multiformats/go-multistream v0.3.9/go.mod h1:fJTiDfXJVmItycydCnNx4+wSzZ5NwG2FEVAI30fiovg=
github.com/obscuren/ecies v0.0.0-20150213224233-7c0f4a9b18d9 h1:Q9JlyQu2TEEvmDnbiwhTis7qt3jpOt8spfuyaO6+vDw=
Expand Down

0 comments on commit d805278

Please sign in to comment.