Merge pull request #42 from euank/improve-makefile-somewhat

makefile: Make misc improvements
This commit is contained in:
Lantao Liu
2016-11-21 16:50:49 -08:00
committed by GitHub
5 changed files with 15 additions and 5 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
/bin/node-problem-detector

View File

@@ -13,5 +13,5 @@ install:
- mv $TRAVIS_BUILD_DIR $HOME/gopath/src/k8s.io/node-problem-detector
- cd $HOME/gopath/src/k8s.io/node-problem-detector
script:
- go test -v -race ./pkg/...
- make test
- go build -race

View File

@@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
FROM alpine:3.1
FROM alpine:3.4
MAINTAINER Random Liu <lantaol@google.com>
ADD node-problem-detector /node-problem-detector
ADD ./bin/node-problem-detector /node-problem-detector
ADD config /config
ENTRYPOINT ["/node-problem-detector", "--kernel-monitor=/config/kernel-monitor.json"]

View File

@@ -1,3 +1,5 @@
.PHONY: all container push clean node-problem-detector
all: push
# See node-problem-detector.yaml for the version currently running-- bump this ahead before rebuilding!
@@ -5,9 +7,16 @@ TAG = v0.2
PROJ = google_containers
node-problem-detector: node_problem_detector.go
PKG_SOURCES := $(shell find pkg -name '*.go')
node-problem-detector: ./bin/node-problem-detector
./bin/node-problem-detector: $(PKG_SOURCES) node_problem_detector.go
CGO_ENABLED=0 GOOS=linux godep go build -a -installsuffix cgo -ldflags '-w' -o node-problem-detector
test:
go test -timeout=1m -v -race ./pkg/...
container: node-problem-detector
docker build -t gcr.io/$(PROJ)/node-problem-detector:$(TAG) .
@@ -15,4 +24,4 @@ push: container
gcloud docker push gcr.io/$(PROJ)/node-problem-detector:$(TAG)
clean:
rm -f node-problem-detector
rm -f ./bin/node-problem-detector

0
bin/.gitkeep Normal file
View File