diff --git a/.travis.yml b/.travis.yml index 87ca354eb..a542922cc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,3 +24,9 @@ before_script: script: - make fmt-check && make build + +deploy: + provider: script + script: bash install/scripts/docker_push + on: + branch: master diff --git a/Makefile b/Makefile index b0612bd0e..9f6faa1b6 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,8 @@ # Use of this source code is governed by a Apache license # that can be found in the LICENSE file. -TRAG.Name:=kubesphere-apiserver +TRAG.Org:=kubesphere +TRAG.Name:=ks-apiserver TRAG.Gopkg:=kubesphere.io/kubesphere TRAG.Version:=$(TRAG.Gopkg)/pkg/version @@ -91,7 +92,7 @@ build: fmt $(call get_build_flags) $(RUN_IN_DOCKER) time go install -ldflags '$(BUILD_FLAG)' $(TRAG.Gopkg)/cmd/... mv ./tmp/bin/cmd ./tmp/bin/$(TRAG.Name) - @docker build -t $(TRAG.Name) -f ./Dockerfile.dev ./tmp + @docker build -t $(TRAG.Org)/$(TRAG.Name) -f ./Dockerfile.dev ./tmp @docker image prune -f 1>/dev/null 2>&1 @echo "build done" diff --git a/install/scripts/docker_push b/install/scripts/docker_push new file mode 100644 index 000000000..966d8460c --- /dev/null +++ b/install/scripts/docker_push @@ -0,0 +1,4 @@ +#!/bin/bash + +echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin +docker push kubesphere/ks-apiserver:latest \ No newline at end of file