From 014f0c4df205b68c30ab0a0d7cbdc3712d3f3e38 Mon Sep 17 00:00:00 2001 From: hongming Date: Tue, 21 Apr 2020 12:32:06 +0800 Subject: [PATCH] update makefile Signed-off-by: hongming --- Makefile | 7 +------ hack/docker_build.sh | 5 +++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 2e221678..f8231c70 100644 --- a/Makefile +++ b/Makefile @@ -10,9 +10,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# The binary to build -BIN ?= ks-apiserver - # Produce CRDs that work back to Kubernetes 1.11 (no version conversion) CRD_OPTIONS ?= "crd:trivialVersions=true" @@ -23,8 +20,6 @@ else GOBIN=$(shell go env GOBIN) endif - -IMG ?= kubespheredev/ks-apiserver OUTPUT_DIR=bin GOFLAGS=-mod=vendor define ALL_HELP_INFO @@ -102,7 +97,7 @@ openapi: go run ./tools/cmd/crd-doc-gen/main.go # Build the docker image docker-build: all - docker build . -t ${IMG} + hack/docker_build.sh # Run tests test: fmt vet diff --git a/hack/docker_build.sh b/hack/docker_build.sh index 81efb298..5d76fc10 100755 --- a/hack/docker_build.sh +++ b/hack/docker_build.sh @@ -4,9 +4,9 @@ set -ex set -o pipefail # Default image repo -REPO=kubespheredev +REPO=${REPO:-kubespheredev} # Set tag to latest if no argument was given, normally was branch name -TAG=${1:-latest} +TAG=${TAG:-latest} docker build -f build/ks-apigateway/Dockerfile -t $REPO/ks-apigateway:$TAG . docker build -f build/ks-apiserver/Dockerfile -t $REPO/ks-apiserver:$TAG . @@ -15,6 +15,7 @@ docker build -f build/ks-controller-manager/Dockerfile -t $REPO/ks-controller-ma docker build -f build/hypersphere/Dockerfile -t $REPO/hypersphere:$TAG . docker build -f ./pkg/db/Dockerfile -t $REPO/ks-devops:flyway-$TAG ./pkg/db/ + # Push image to dockerhub, need to support multiple push echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin -- GitLab