lddsb / drone-dingtalk-message

A plugins for drone ci to message a group by robot
MIT License
64 stars 31 forks source link

why not use my tpl? #7

Closed Veitor closed 4 years ago

Veitor commented 4 years ago

my .drone.yml:

kind: pipeline
name: test-ci-notification

steps:
  - name: notification
    image: lddsb/drone-dingtalk-message
    settings:
      token:
        from_secret: dingTalkToken
      type: markdown
      tpl: ./ci-notification.tpl

and I put my tpl file named ci-notification.tpl in git repository root directory. but message I received don't use my tpl content. Is my tpl setting is wrong?

Veitor commented 4 years ago

ok. I have resolved after specify docker image tag.

    image: lddsb/drone-dingtalk-message

change to

    image: lddsb/drone-dingtalk-message:1.2.1

Does the latest version of the default should not include this feature?

tfzxyinhao commented 4 years ago

hi,i get the error 'tpl file not exists'. the tpl file was location at root of the my project

Veitor commented 4 years ago

hi,i get the error 'tpl file not exists'. the tpl file was location at root of the my project

我就直接跟你中文说了,省的麻烦了。 你这我也没遇到过,不过可能猜测有

  1. 先看你指定的tpl路径是相对的还是绝对的,排除路径是否写错
  2. 有没有被gitignore忽略没放到库里 3 可以在pipeline加一个step,使用ls等命令查看一下CI环境中的文件里有没有你这个文件
  3. 剩下的难道不会是权限问题吧?我看作者源码判断还是比较简单的:https://github.com/lddsb/drone-dingtalk-message/blob/8aafd04b82f1d784e2ee3c53d32626af5389fdf4/plugin.go, 不知道会不会因为权限而判断错误
tfzxyinhao commented 4 years ago
name: test-ci-notification

steps:
  - name: notification
    image: lddsb/drone-dingtalk-message
    settings:
      token:
        from_secret: dingTalkToken
      type: markdown
      tpl: ./ci-notification.tpl 

我的配置跟楼主一样,测试了一下, 放在项目跟目录的. 源码我也看了. 怀疑是 这个stop和 work 目录 不在同一个维度

Veitor commented 4 years ago
name: test-ci-notification

steps:
  - name: notification
    image: lddsb/drone-dingtalk-message
    settings:
      token:
        from_secret: dingTalkToken
      type: markdown
      tpl: ./ci-notification.tpl 

我的配置跟楼主一样,测试了一下, 放在项目跟目录的. 源码我也看了. 怀疑是 这个stop和 work 目录 不在同一个维度

那你按我2楼的回复指定一个image tag吧,就指定我试的1.2.1的,免得作者不知道改了什么而产生非预期的错误

tfzxyinhao commented 4 years ago
name: test-ci-notification

steps:
  - name: notification
    image: lddsb/drone-dingtalk-message
    settings:
      token:
        from_secret: dingTalkToken
      type: markdown
      tpl: ./ci-notification.tpl 

我的配置跟楼主一样,测试了一下, 放在项目跟目录的. 源码我也看了. 怀疑是 这个stop和 work 目录 不在同一个维度

那你按我2楼的回复指定一个image tag吧,就指定我试的1.2.1的,免得作者不知道改了什么而产生非预期的错误

感谢耐心解答. 我测试时image加了版本号得.