refactor: upgrade drone to 0.6 (#219)

* refactor: upgrade drone to 0.6

* fix path.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* fix path.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* fix redis host.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu 2017-05-04 11:09:07 +08:00 committed by GitHub
parent 7a622eef6f
commit 6510427a14
3 changed files with 27 additions and 26 deletions

View File

@ -1,16 +1,19 @@
workspace: workspace:
path: /go/src/github.com/appleboy/gorush base: /srv/app
path: src/github.com/appleboy/gorush
pipeline: clone:
clone: git:
image: plugins/git image: plugins/git
depth: 50 depth: 50
tags: true tags: true
pipeline:
build: build:
image: appleboy/golang-testing:${GO_VERSION} image: appleboy/golang-testing
secrets: [ codecov_token, android_test_token, android_api_key ]
environment: environment:
- GOPATH=/go - GOPATH=/srv/app
commands: commands:
- make deps - make deps
- make vet - make vet
@ -24,7 +27,7 @@ pipeline:
- make docker_build - make docker_build
release: release:
image: appleboy/golang-testing:${GO_VERSION} image: appleboy/golang-testing
pull: true pull: true
environment: environment:
TAGS: netgo TAGS: netgo
@ -39,6 +42,7 @@ pipeline:
docker: docker:
image: plugins/docker image: plugins/docker
repo: appleboy/gorush repo: appleboy/gorush
secrets: [ docker_username, docker_password ]
tags: [ '${DRONE_TAG}' ] tags: [ '${DRONE_TAG}' ]
when: when:
event: [ tag ] event: [ tag ]
@ -47,23 +51,15 @@ pipeline:
docker: docker:
image: plugins/docker image: plugins/docker
repo: appleboy/gorush repo: appleboy/gorush
secrets: [ docker_username, docker_password ]
tags: [ 'latest' ] tags: [ 'latest' ]
when: when:
event: [ push ] event: [ push ]
branch: [ master ] branch: [ master ]
facebook:
image: appleboy/drone-facebook
pull: true
to: 1234973386524610
when:
status: [ success, failure ]
matrix:
GO_VERSION: 1.8.0
github: github:
image: plugins/github-release image: plugins/github-release
api_key: ${GITHUB_RELEASE_API_KEY} secrets: [ github_token ]
files: files:
- dist/release/* - dist/release/*
when: when:
@ -72,11 +68,16 @@ pipeline:
matrix: matrix:
GO_VERSION: 1.8.0 GO_VERSION: 1.8.0
facebook:
image: appleboy/drone-facebook
secrets: [ fb_page_token, fb_verify_token ]
pull: true
to: 1234973386524610
when:
status: [ success, failure ]
matrix:
GO_VERSION: 1.8.0
services: services:
redis: redis:
image: redis:alpine image: redis:alpine
matrix:
GO_VERSION:
- 1.8.0
- 1.7.5

View File

@ -41,7 +41,7 @@ func TestStatForMemoryEngine(t *testing.T) {
func TestRedisServerSuccess(t *testing.T) { func TestRedisServerSuccess(t *testing.T) {
PushConf.Stat.Engine = "redis" PushConf.Stat.Engine = "redis"
PushConf.Stat.Redis.Addr = "localhost:6379" PushConf.Stat.Redis.Addr = "redis:6379"
err := InitAppStatus() err := InitAppStatus()
@ -50,7 +50,7 @@ func TestRedisServerSuccess(t *testing.T) {
func TestRedisServerError(t *testing.T) { func TestRedisServerError(t *testing.T) {
PushConf.Stat.Engine = "redis" PushConf.Stat.Engine = "redis"
PushConf.Stat.Redis.Addr = "localhost:6370" PushConf.Stat.Redis.Addr = "redis:6370"
err := InitAppStatus() err := InitAppStatus()
@ -60,7 +60,7 @@ func TestRedisServerError(t *testing.T) {
func TestStatForRedisEngine(t *testing.T) { func TestStatForRedisEngine(t *testing.T) {
var val int64 var val int64
PushConf.Stat.Engine = "redis" PushConf.Stat.Engine = "redis"
PushConf.Stat.Redis.Addr = "localhost:6379" PushConf.Stat.Redis.Addr = "redis:6379"
InitAppStatus() InitAppStatus()
StatStorage.Init() StatStorage.Init()

View File

@ -9,7 +9,7 @@ import (
func TestRedisServerError(t *testing.T) { func TestRedisServerError(t *testing.T) {
config := c.BuildDefaultPushConf() config := c.BuildDefaultPushConf()
config.Stat.Redis.Addr = "localhost:6370" config.Stat.Redis.Addr = "redis:6370"
redis := New(config) redis := New(config)
err := redis.Init() err := redis.Init()
@ -21,7 +21,7 @@ func TestRedisEngine(t *testing.T) {
var val int64 var val int64
config := c.BuildDefaultPushConf() config := c.BuildDefaultPushConf()
config.Stat.Redis.Addr = "localhost:6379" config.Stat.Redis.Addr = "redis:6379"
redis := New(config) redis := New(config)
redis.Init() redis.Init()