auto upload image on master pr

This commit is contained in:
jeff
2018-06-20 20:40:56 +08:00
parent 1242ca743d
commit 350171a3b0
3 changed files with 13 additions and 2 deletions

View File

@@ -24,3 +24,9 @@ before_script:
script:
- make fmt-check && make build
deploy:
provider: script
script: bash install/scripts/docker_push
on:
branch: master

View File

@@ -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"

View File

@@ -0,0 +1,4 @@
#!/bin/bash
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
docker push kubesphere/ks-apiserver:latest