diff --git a/.drone.yml b/.drone.yml index 62903ef..95dbaa8 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,16 +1,19 @@ workspace: - path: /go/src/github.com/appleboy/gorush + base: /srv/app + path: src/github.com/appleboy/gorush -pipeline: - clone: +clone: + git: image: plugins/git depth: 50 tags: true +pipeline: build: - image: appleboy/golang-testing:${GO_VERSION} + image: appleboy/golang-testing + secrets: [ codecov_token, android_test_token, android_api_key ] environment: - - GOPATH=/go + - GOPATH=/srv/app commands: - make deps - make vet @@ -24,7 +27,7 @@ pipeline: - make docker_build release: - image: appleboy/golang-testing:${GO_VERSION} + image: appleboy/golang-testing pull: true environment: TAGS: netgo @@ -39,6 +42,7 @@ pipeline: docker: image: plugins/docker repo: appleboy/gorush + secrets: [ docker_username, docker_password ] tags: [ '${DRONE_TAG}' ] when: event: [ tag ] @@ -47,23 +51,15 @@ pipeline: docker: image: plugins/docker repo: appleboy/gorush + secrets: [ docker_username, docker_password ] tags: [ 'latest' ] when: event: [ push ] branch: [ master ] - facebook: - image: appleboy/drone-facebook - pull: true - to: 1234973386524610 - when: - status: [ success, failure ] - matrix: - GO_VERSION: 1.8.0 - github: image: plugins/github-release - api_key: ${GITHUB_RELEASE_API_KEY} + secrets: [ github_token ] files: - dist/release/* when: @@ -72,11 +68,16 @@ pipeline: matrix: 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: redis: image: redis:alpine - -matrix: - GO_VERSION: - - 1.8.0 - - 1.7.5 diff --git a/gorush/status_test.go b/gorush/status_test.go index ba9f5c8..0d77984 100644 --- a/gorush/status_test.go +++ b/gorush/status_test.go @@ -41,7 +41,7 @@ func TestStatForMemoryEngine(t *testing.T) { func TestRedisServerSuccess(t *testing.T) { PushConf.Stat.Engine = "redis" - PushConf.Stat.Redis.Addr = "localhost:6379" + PushConf.Stat.Redis.Addr = "redis:6379" err := InitAppStatus() @@ -50,7 +50,7 @@ func TestRedisServerSuccess(t *testing.T) { func TestRedisServerError(t *testing.T) { PushConf.Stat.Engine = "redis" - PushConf.Stat.Redis.Addr = "localhost:6370" + PushConf.Stat.Redis.Addr = "redis:6370" err := InitAppStatus() @@ -60,7 +60,7 @@ func TestRedisServerError(t *testing.T) { func TestStatForRedisEngine(t *testing.T) { var val int64 PushConf.Stat.Engine = "redis" - PushConf.Stat.Redis.Addr = "localhost:6379" + PushConf.Stat.Redis.Addr = "redis:6379" InitAppStatus() StatStorage.Init() diff --git a/storage/redis/redis_test.go b/storage/redis/redis_test.go index 37e3ae1..d8b6e5d 100644 --- a/storage/redis/redis_test.go +++ b/storage/redis/redis_test.go @@ -9,7 +9,7 @@ import ( func TestRedisServerError(t *testing.T) { config := c.BuildDefaultPushConf() - config.Stat.Redis.Addr = "localhost:6370" + config.Stat.Redis.Addr = "redis:6370" redis := New(config) err := redis.Init() @@ -21,7 +21,7 @@ func TestRedisEngine(t *testing.T) { var val int64 config := c.BuildDefaultPushConf() - config.Stat.Redis.Addr = "localhost:6379" + config.Stat.Redis.Addr = "redis:6379" redis := New(config) redis.Init()