Skip to content

Commit

Permalink
Add make builder and make build-docker
Browse files Browse the repository at this point in the history
  • Loading branch information
karlkfi committed Sep 7, 2015
1 parent c53da63 commit 0505bd1
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
GOPATH=$(shell cd ../../../.. && pwd)

VERSION=$(shell git describe --long --tags --dirty --always)

# Apply -dirty version suffix if there are staged or unstaged changes in ./builder
BUILDER_DIRTY=$(shell git diff-files --quiet -- "builder" && git diff-index --quiet --cached HEAD -- "builder" || echo "-dirty")
# Version builder by short commit sha of the builder dir, not the last probe version tag
BUILDER_VERSION=$(shell git rev-list -1 HEAD -- "builder" | cut -c1-7)${BUILDER_DIRTY}

default: all

all: restoredeps test build
Expand Down Expand Up @@ -46,3 +53,12 @@ clean:

env:
@godep go env

.PHONY: builder
builder:
@echo "--> Building builder: karlkfi/probe-builder:${BUILDER_VERSION}"
@docker build -t karlkfi/probe-builder:${BUILDER_VERSION} ./builder

build-docker:
@echo "--> Building probe (in karlkfi/probe-builder:${BUILDER_VERSION})"
@docker run -v "$(shell pwd):/go/src/github.com/karlkfi/probe" karlkfi/probe-builder:${BUILDER_VERSION}
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,27 @@ probe -t 1s https://example.com/
The error description will be printed to STDERR.


### Building

Build locally:

```
make
```

Build in docker:

```
make build-docker
```

Build docker builder:

```
make builder
```


### TODO

1. Add SSL certificate validation options (currently ignores cert validity).
Expand Down

0 comments on commit 0505bd1

Please sign in to comment.