From d36fa5f9ff349ad8401b716940d25a3330734349 Mon Sep 17 00:00:00 2001 From: Olivier Gambier Date: Tue, 20 Oct 2015 13:18:02 -0700 Subject: [PATCH] Minor cleanup and fix #2022 Signed-off-by: Olivier Gambier --- Makefile | 28 +++++++++++++++------------- cli/.travis.yml | 2 +- mk/main.mk | 7 ++----- mk/release.mk | 2 -- script/test | 12 ------------ 5 files changed, 18 insertions(+), 33 deletions(-) delete mode 100755 script/test diff --git a/Makefile b/Makefile index 8d2433f4be..7705f02021 100644 --- a/Makefile +++ b/Makefile @@ -10,25 +10,27 @@ else DOCKER_IMAGE_NAME := "docker-machine-build" DOCKER_CONTAINER_NAME := "docker-machine-build-container" -build: -test: build +.ignore: + @ + +test: .ignore %: docker build -t $(DOCKER_IMAGE_NAME) . test -z '$(shell docker ps -a | grep $(DOCKER_CONTAINER_NAME))' || docker rm -f $(DOCKER_CONTAINER_NAME) docker run --name $(DOCKER_CONTAINER_NAME) \ - -e DEBUG \ - -e STATIC \ - -e VERBOSE \ - -e BUILDTAGS \ - -e PARALLEL \ - -e COVERAGE_DIR \ - -e TARGET_OS \ - -e TARGET_ARCH \ - -e PREFIX \ - $(DOCKER_IMAGE_NAME) \ - make $@ + -e DEBUG \ + -e STATIC \ + -e VERBOSE \ + -e BUILDTAGS \ + -e PARALLEL \ + -e COVERAGE_DIR \ + -e TARGET_OS \ + -e TARGET_ARCH \ + -e PREFIX \ + $(DOCKER_IMAGE_NAME) \ + make $@ test ! -d bin || rm -Rf bin test -z "$(findstring build,$(patsubst cross,build,$@))" || docker cp $(DOCKER_CONTAINER_NAME):/go/src/github.com/docker/machine/bin bin diff --git a/cli/.travis.yml b/cli/.travis.yml index 001d637750..755e2840c4 100644 --- a/cli/.travis.yml +++ b/cli/.travis.yml @@ -10,4 +10,4 @@ go: script: - go vet ./... -- go test -race -v ./libmachine/... ./commands/... ./drivers/... +- go test -race -v ./... diff --git a/mk/main.mk b/mk/main.mk index bfcff4ee0c..ce18e9bce7 100644 --- a/mk/main.mk +++ b/mk/main.mk @@ -3,7 +3,7 @@ GO_LDFLAGS := -X `go list ./version`.GitCommit=`git rev-parse --short HEAD` GO_GCFLAGS := # Full package list -PKGS := $(shell go list -tags "$(BUILDTAGS)" ./commands/... ./libmachine/... ./drivers/... | grep -v "/vendor/" | grep -v "/Godeps/") +PKGS := $(shell go list -tags "$(BUILDTAGS)" ./... | grep -v "/vendor/" | grep -v "/Godeps/" | grep -v "/cmd") # Support go1.5 vendoring (let us avoid messing with GOPATH or using godep) export GO15VENDOREXPERIMENT = 1 @@ -32,7 +32,6 @@ VERBOSE_GO := GO := go ifeq ($(VERBOSE),true) VERBOSE_GO := -v - GO := go endif include mk/build.mk @@ -58,9 +57,7 @@ plugins: build-plugins cross: build-x clean: coverage-clean build-clean -test: dco fmt vet test-short +test: dco fmt test-short vet validate: dco fmt vet lint test-short test-long -install: - cp ./bin/docker-machine* /usr/local/bin/ .PHONY: .all_build .all_coverage .all_release .all_test .all_validate test build validate clean diff --git a/mk/release.mk b/mk/release.mk index 8e95ba0ea0..fdc245f565 100644 --- a/mk/release.mk +++ b/mk/release.mk @@ -17,8 +17,6 @@ release: clean dco fmt test test-long build-x release-pack release-checksum $(if $(VERSION), , \ $(error Pass the version number as the first arg. E.g.: make release 1.2.3)) - echo $(VERSION) - git tag $(VERSION) git push --tags diff --git a/script/test b/script/test deleted file mode 100755 index 40cef2e712..0000000000 --- a/script/test +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -set -e - -ARGS=$@ -if [ -z "$ARGS" ]; then - ARGS="./libmachine/... ./commands/... ./drivers/..." -fi - -echo $ARGS - -docker build -t docker-machine . -exec docker run --rm docker-machine godep go test -race -v -short $ARGS