chore: testing send message

This commit is contained in:
Bo-Yi Wu 2019-09-26 00:39:41 +08:00
parent 31944fe6c9
commit 5d8f84999a
2 changed files with 35 additions and 15 deletions

View File

@ -73,7 +73,7 @@ steps:
pull: always pull: always
image: golang:1.13 image: golang:1.13
commands: commands:
- "go build -v -ldflags '-X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/amd64/drone-telegram" - go build -v -ldflags '-X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/amd64/drone-telegram
environment: environment:
CGO_ENABLED: 0 CGO_ENABLED: 0
when: when:
@ -85,7 +85,7 @@ steps:
pull: always pull: always
image: golang:1.13 image: golang:1.13
commands: commands:
- "go build -v -ldflags '-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/amd64/drone-telegram" - go build -v -ldflags '-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/amd64/drone-telegram
environment: environment:
CGO_ENABLED: 0 CGO_ENABLED: 0
when: when:
@ -133,8 +133,8 @@ steps:
trigger: trigger:
ref: ref:
- refs/heads/master - refs/heads/master
- "refs/pull/**" - refs/pull/**
- "refs/tags/**" - refs/tags/**
depends_on: depends_on:
- testing - testing
@ -152,7 +152,7 @@ steps:
pull: always pull: always
image: golang:1.13 image: golang:1.13
commands: commands:
- "go build -v -ldflags '-X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm64/drone-telegram" - go build -v -ldflags '-X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm64/drone-telegram
environment: environment:
CGO_ENABLED: 0 CGO_ENABLED: 0
when: when:
@ -164,7 +164,7 @@ steps:
pull: always pull: always
image: golang:1.13 image: golang:1.13
commands: commands:
- "go build -v -ldflags '-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm64/drone-telegram" - go build -v -ldflags '-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm64/drone-telegram
environment: environment:
CGO_ENABLED: 0 CGO_ENABLED: 0
when: when:
@ -212,8 +212,8 @@ steps:
trigger: trigger:
ref: ref:
- refs/heads/master - refs/heads/master
- "refs/pull/**" - refs/pull/**
- "refs/tags/**" - refs/tags/**
depends_on: depends_on:
- testing - testing
@ -231,7 +231,7 @@ steps:
pull: always pull: always
image: golang:1.13 image: golang:1.13
commands: commands:
- "go build -v -ldflags '-X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm/drone-telegram" - go build -v -ldflags '-X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm/drone-telegram
environment: environment:
CGO_ENABLED: 0 CGO_ENABLED: 0
when: when:
@ -243,7 +243,7 @@ steps:
pull: always pull: always
image: golang:1.13 image: golang:1.13
commands: commands:
- "go build -v -ldflags '-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm/drone-telegram" - go build -v -ldflags '-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm/drone-telegram
environment: environment:
CGO_ENABLED: 0 CGO_ENABLED: 0
when: when:
@ -291,8 +291,8 @@ steps:
trigger: trigger:
ref: ref:
- refs/heads/master - refs/heads/master
- "refs/pull/**" - refs/pull/**
- "refs/tags/**" - refs/tags/**
depends_on: depends_on:
- testing - testing
@ -322,14 +322,14 @@ steps:
api_key: api_key:
from_secret: github_release_api_key from_secret: github_release_api_key
files: files:
- "dist/release/*" - dist/release/*
when: when:
event: event:
- tag - tag
trigger: trigger:
ref: ref:
- "refs/tags/**" - refs/tags/**
depends_on: depends_on:
- testing - testing
@ -343,6 +343,16 @@ platform:
arch: amd64 arch: amd64
steps: steps:
- name: telegram
pull: always
image: appleboy/drone-telegram:1.3.1
settings:
message: "{{#success build.status}} ✅ Build #{{build.number}} of `{{repo.name}}` succeeded.\n\n📝 Commit by {{commit.author}} on `{{commit.branch}}`:\n``` {{commit. message}} ```\n\n🌐 {{ build.link }} {{else}} ❌ Build #{{build.number}} of `{{repo.name}}` failed.\n\n📝 Commit by {{commit.author}} on `{{commit.branch}}`:\n``` {{commit. message}} ```\n\n🌐 {{ build.link }} {{/success}}\n"
to:
from_secret: telegram_to
token:
from_secret: telegram_token
- name: manifest - name: manifest
pull: always pull: always
image: plugins/manifest image: plugins/manifest
@ -364,7 +374,7 @@ steps:
trigger: trigger:
ref: ref:
- refs/heads/master - refs/heads/master
- "refs/tags/**" - refs/tags/**
depends_on: depends_on:
- linux-amd64 - linux-amd64

View File

@ -230,6 +230,16 @@
arch: arch, arch: arch,
}, },
steps: [ steps: [
{
name: 'telegram',
image: 'appleboy/drone-telegram:1.3.1',
pull: 'always',
settings: {
to: { from_secret: 'telegram_to' },
token: { from_secret: 'telegram_token' },
message: '{{#success build.status}} ✅ Build #{{build.number}} of `{{repo.name}}` succeeded.\n\n📝 Commit by {{commit.author}} on `{{commit.branch}}`:\n``` {{commit. message}} ```\n\n🌐 {{ build.link }} {{else}} ❌ Build #{{build.number}} of `{{repo.name}}` failed.\n\n📝 Commit by {{commit.author}} on `{{commit.branch}}`:\n``` {{commit. message}} ```\n\n🌐 {{ build.link }} {{/success}}\n',
},
},
{ {
name: 'manifest', name: 'manifest',
image: 'plugins/manifest', image: 'plugins/manifest',