Skip to content

Commit 3132378

Browse files
authored
Merge pull request #42 from euank/improve-makefile-somewhat
makefile: Make misc improvements
2 parents 077dafc + 8cdf7b1 commit 3132378

File tree

5 files changed

+15
-5
lines changed

5 files changed

+15
-5
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/bin/node-problem-detector

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ install:
1313
- mv $TRAVIS_BUILD_DIR $HOME/gopath/src/k8s.io/node-problem-detector
1414
- cd $HOME/gopath/src/k8s.io/node-problem-detector
1515
script:
16-
- go test -v -race ./pkg/...
16+
- make test
1717
- go build -race

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM alpine:3.1
15+
FROM alpine:3.4
1616
MAINTAINER Random Liu <[email protected]>
17-
ADD node-problem-detector /node-problem-detector
17+
ADD ./bin/node-problem-detector /node-problem-detector
1818
ADD config /config
1919
ENTRYPOINT ["/node-problem-detector", "--kernel-monitor=/config/kernel-monitor.json"]

Makefile

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,27 @@
1+
.PHONY: all container push clean node-problem-detector
2+
13
all: push
24

35
# See node-problem-detector.yaml for the version currently running-- bump this ahead before rebuilding!
46
TAG = v0.2
57

68
PROJ = google_containers
79

8-
node-problem-detector: node_problem_detector.go
10+
PKG_SOURCES := $(shell find pkg -name '*.go')
11+
12+
node-problem-detector: ./bin/node-problem-detector
13+
14+
./bin/node-problem-detector: $(PKG_SOURCES) node_problem_detector.go
915
CGO_ENABLED=0 GOOS=linux godep go build -a -installsuffix cgo -ldflags '-w' -o node-problem-detector
1016

17+
test:
18+
go test -timeout=1m -v -race ./pkg/...
19+
1120
container: node-problem-detector
1221
docker build -t gcr.io/$(PROJ)/node-problem-detector:$(TAG) .
1322

1423
push: container
1524
gcloud docker push gcr.io/$(PROJ)/node-problem-detector:$(TAG)
1625

1726
clean:
18-
rm -f node-problem-detector
27+
rm -f ./bin/node-problem-detector

bin/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)