Skip to content

Commit 07d0698

Browse files
fix: improved Makefile (#210)
- adds check for go-lint and statik before installing - renamed install target to setup to avoid confusion - updated README.md to reflect changes
1 parent 5992a99 commit 07d0698

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,4 +132,4 @@ jobs:
132132
before_script:
133133
# https://github.com/travis-ci/gimme
134134
- eval "$(gimme)"
135-
- make -e install build
135+
- make -e setup build

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,13 @@ cover: check-go static ## runs test suite with coverage profiling
4949
cover-html: cover ## generates test coverage html report
5050
$(GOCMD) tool cover -html=$(COVER_FILE)
5151

52-
install: check-go ## installs all dev and ci dependencies, but does not install golang
52+
setup: check-go ## installs all dev and ci dependencies, but does not install golang
53+
ifeq (,$(wildcard $(GOLINT)))
5354
curl -sfL https://github.com/raw/golangci/golangci-lint/master/install.sh| sh -s -- -b $(GOPATH)/bin v1.19.0
55+
endif
56+
ifeq (,$(wildcard $(GOPATH)/bin/statik))
5457
go get github.com/rakyll/statik
58+
endif
5559

5660
lint: check-go static ## runs `golangci-lint` linters defined in `.golangci.yml` file
5761
$(GOLINT) run --out-format=tab --tests=false ./...

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Installers and binary archives for most platforms can be downloaded directly fro
1919
## Running from source (Linux / OSX)
2020
Once Go is installed, the Optimizely Agent can be started via the following `make` command:
2121
```bash
22-
make install
22+
make setup
2323
make run
2424
```
2525
This will start the Optimizely Agent with the default configuration in the foreground.

scripts/dockerfiles/Dockerfile.alpine

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ FROM golang:$GO_VERSION-alpine3.10 as builder
44
RUN apk add --no-cache make gcc libc-dev git
55
WORKDIR /go/src/github.com/optimizely/agent
66
COPY . .
7-
RUN make install
8-
RUN make build
7+
RUN make setup build
98

109
FROM alpine:3.10
1110
RUN apk add --no-cache ca-certificates=20190108-r0

scripts/dockerfiles/Dockerfile.static

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM golang:$GO_VERSION as builder
33

44
WORKDIR /go/src/github.com/optimizely/agent
55
COPY . .
6-
RUN make install build
6+
RUN make setup build
77
RUN make ci_build_static_binary
88

99
FROM scratch

0 commit comments

Comments
 (0)