Sign inSign up

sinlov/drone-feishu-group-robot

By sinlov

Updated about 2 years ago

drone CI use feishu https://open.feishu.cn/document/ukTMukTMukTM/ucTM5YjL3ETO24yNxkjN

Image
0

10K+

sinlov/drone-feishu-group-robot repository overview

docker hub version semver docker hub image size docker hub image pulls

GitHub license codecov GitHub latest SemVer tag) GitHub release)

for what

  • this project used to drone CI use Custom bot guide
  • support drone-docker platform=linux/arm,linux/arm64,linux/amd64
  • support drone-exec

Features

v1.15.+
  • let feishu message card render HeadTemplateStyle support different event

  • build status success

  • build status failure

  • pull request status success

  • pull request status failure

  • tag status success

more features

before use

  • sed doc at feishu Custom bot guide, to new group robot
  • Configure webhook like https://open.feishu.cn/open-apis/bot/v2/hook/{web_hook} end {web_hook}
  • {web_hook} must settings at settings.feishu_webhookor PLUGIN_FEISHU_WEBHOOK
  • if set Custom keywords you can change settings.feishu_msg_title or PLUGIN_FEISHU_MSG_TITLE
  • or set Signature validation by settings.feishu_secret or PLUGIN_FEISHU_SECRET

Pipeline Settings (.drone.yml)

  • 1.x docker

sample config

steps:
  - name: notification-feishu-group-robot
    image: sinlov/drone-feishu-group-robot:1.15.0
    pull: if-not-exists
    # image: sinlov/drone-feishu-group-robot:latest
    settings:
      # debug: true # plugin debug switch
      # ntp_target: "pool.ntp.org" # if not set will not sync ntp time
      feishu_webhook:
        # https://docs.drone.io/pipeline/environment/syntax/#from-secrets
        from_secret: feishu_group_bot_token
      feishu_secret:
        from_secret: feishu_group_secret_bot
      feishu_msg_title: "Drone CI Notification" # default [Drone CI Notification]
      # let notification card change more info see https://open.feishu.cn/document/ukTMukTMukTM/uAjNwUjLwYDM14CM2ATN
      feishu_enable_forward: true
    when:
      event: # https://docs.drone.io/pipeline/exec/syntax/conditions/#by-event
        - promote
        - rollback
        - push
        - pull_request
        - tag
      status: # only support failure/success,  both open will send anything
        - failure
        - success

full config

steps:
  - name: notification-feishu-group-robot
    image: sinlov/drone-feishu-group-robot:latest
    settings:
      debug: true # plugin debug switch
      # ntp_target: "pool.ntp.org" # if not set will not sync ntp time
      timeout_second: 10 # default 10
      feishu_webhook:
        # https://docs.drone.io/pipeline/environment/syntax/#from-secrets
        from_secret: feishu_group_bot_token
      feishu_secret:
        from_secret: feishu_group_secret_bot
      # ignore last success branch by badges
      feishu_ignore_last_success_by_badges: true # will check branch badges, if success will not send message, tag build will not pass, default false
      feishu_ignore_last_success_branch: main # if not set, will use now drone build branch, and now branch status is started so not ignore, and if in tag mode, will not ignore
      # let notification card change more info see https://open.feishu.cn/document/ukTMukTMukTM/uAjNwUjLwYDM14CM2ATN
      feishu_msg_title: "Drone CI Notification" # default [Drone CI Notification]
      feishu_enable_forward: true
      drone_system_admin_token: # non-essential parameter 1.9.0+
        from_secret: drone_system_admin_token
      # ignore last success by distance
      feishu_ignore_last_success_by_admin_token_distance: 2 # if distance is 0 or now is tag will not ignore, use 1 will let notify build change to success, most use 2 to support tag release
      # oss info
      feishu_oss_host: "https://xxx.com" # OSS host for show oss info, if empty will not show oss info
      feishu_oss_info_send_result: ${DRONE_BUILD_STATUS} # append oss info must set success
      feishu_oss_info_user: "admin" # OSS user for show at card
      feishu_oss_info_path: "dist/foo/bar" # OSS path for show at card
      feishu_oss_resource_url: "https://xxx.com/s/xxx" # OSS resource url
      feishu_oss_page_url: "https://xxx.com/p/xxx" # OSS page url
      feishu_oss_page_passwd: "abc_xyz" # OSS password at page url, will hide PLUGIN_FEISHU_OSS_RESOURCE_URL when PAGE_PASSWD not empty 
    when:
      event: # https://docs.drone.io/pipeline/exec/syntax/conditions/#by-event
        - promote
        - rollback
        - push
        - pull_request
        - tag
      status: # only support failure/success,  both open will send anything
        - failure
        - success

Tag summary

Content type

Image

Digest

sha256:d965c2fc2

Size

7.1 MB

Last updated

about 2 years ago

docker pull sinlov/drone-feishu-group-robot