From 2c880a2d67b8c549499b35bc495783d015214cd3 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Mon, 3 Oct 2016 13:42:29 +0800 Subject: [PATCH] support gtalk notification on drone. Signed-off-by: Bo-Yi Wu --- .drone.yml | 11 +++++++++++ .drone.yml.sig | 2 +- config/config.go | 3 ++- gorush.go | 5 +++-- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/.drone.yml b/.drone.yml index ad7380b..82d4e82 100644 --- a/.drone.yml +++ b/.drone.yml @@ -23,6 +23,15 @@ pipeline: matrix: GO_VERSION: 1.7.1 + gtalk: + image: appleboy/drone-gtalk + pull: true + to: appleboy.tw@gmail.com + when: + status: [ success, failure ] + matrix: + GO_VERSION: 1.7.1 + facebook: image: appleboy/drone-facebook pull: true @@ -40,6 +49,8 @@ pipeline: ignore_branch: true when: branch: master + matrix: + GO_VERSION: 1.7.1 services: redis: diff --git a/.drone.yml.sig b/.drone.yml.sig index a96cb45..cc48437 100644 --- a/.drone.yml.sig +++ b/.drone.yml.sig @@ -1 +1 @@ -eyJhbGciOiJIUzI1NiJ9.cGlwZWxpbmU6CiAgIyByZXN0b3JlIHRoZSBjYWNoZSBmcm9tIGFuIHNmdHAgc2VydmVyCiAgcmVzdG9yZV9jYWNoZToKICAgIGltYWdlOiBhcHBsZWJveS9kcm9uZS1zZnRwLWNhY2hlCiAgICByZXN0b3JlOiB0cnVlCiAgICBtb3VudDogWyAuZ2xpZGUsIHZlbmRvciBdCiAgICBpZ25vcmVfYnJhbmNoOiB0cnVlCgogIGJ1aWxkOgogICAgaW1hZ2U6IGFwcGxlYm95L2dvbGFuZy10ZXN0aW5nOiR7R09fVkVSU0lPTn0KICAgIGVudmlyb25tZW50OgogICAgICAtIEdPUEFUSD0vZ28KICAgIGNvbW1hbmRzOgogICAgICAtIG1ha2UgaW5zdGFsbAogICAgICAtIGNvdmVyYWdlIGFsbAoKICBsaW5lOgogICAgaW1hZ2U6IGFwcGxlYm95L2Ryb25lLWxpbm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9uZS1zZnRwLWNhY2hlCiAgICByZWJ1aWxkOiB0cnVlCiAgICBtb3VudDogWyAuZ2xpZGUsIHZlbmRvciBdCiAgICBpZ25vcmVfYnJhbmNoOiB0cnVlCiAgICB3aGVuOgogICAgICBicmFuY2g6IG1hc3RlcgogICAgICBtYXRyaXg6CiAgICAgICAgR09fVkVSU0lPTjogMS43LjEKCnNlcnZpY2VzOgogIHJlZGlzOgogICAgaW1hZ2U6IHJlZGlzOmFscGluZQoKd29ya3NwYWNlOgogIHBhdGg6IC9nby9zcmMvZ2l0aHViLmNvbS9hcHBsZWJveS9nb3J1c2gKCm1hdHJpeDoKICBHT19WRVJTSU9OOgogICAgLSAxLjcuMQogICAgLSAxLjYuMwo.A944ZNCmn8WqJ1mTXFcOUPRk5LjvErNRu2uqm7QTpyQ \ No newline at end of file diff --git a/config/config.go b/config/config.go index f98c8a7..58c6e97 100644 --- a/config/config.go +++ b/config/config.go @@ -1,9 +1,10 @@ package config import ( - "gopkg.in/yaml.v2" "io/ioutil" "runtime" + + "gopkg.in/yaml.v2" ) // ConfYaml is config structure. diff --git a/gorush.go b/gorush.go index f7c8d7b..00c7f1a 100644 --- a/gorush.go +++ b/gorush.go @@ -3,11 +3,12 @@ package main import ( "flag" "fmt" - "github.com/appleboy/gorush/config" - "github.com/appleboy/gorush/gorush" "log" "os" "strconv" + + "github.com/appleboy/gorush/config" + "github.com/appleboy/gorush/gorush" ) func checkInput(token, message string) {