travis-ci / travis-yaml

parses, normalizes, validates and serializes your .travis.yml
http://yaml.travis-ci.org/
MIT License
170 stars 66 forks source link

【BUG】the setting variable not work #92

Open yozman opened 8 years ago

yozman commented 8 years ago

heyguys,

when I try to use webhook as string it works like this:

notifications:
  webhooks:
    urls:
      - https://hooks.pubu.im/services/whatthefly
    on_start: always

but when I try to replace the token whatthefly, use Environment Variables like this:

notifications:
  webhooks:
    urls:
      - https://hooks.pubu.im/services/$TOKEN
    on_start: always

it doesn't work, I'm sure I have the right setting.

could you tell me what should I do to let it work?

huan commented 8 years ago

I have the same issue, webhooks does not work with urls include ENVIRONMENT VARIABLES ? my travis.yml here: https://github.com/zixia/wechaty/blob/master/.travis.yml

BanzaiMan commented 8 years ago

Notifications don't have access to the environment variables.

huan commented 8 years ago

@BanzaiMan thanks for point this out. It seems the document seems not clear enough, and lots of project use environment variables in notifications, like those:

  1. https://github.com/meanjs/mean/blob/master/.travis.yml#L45
  2. https://github.com/machinekit/machinekit/blob/master/.travis.yml#L3

I have 1 more question:

if I want to use gitter & docker hub webhooks in notifications, how could I protect my webhook key? or I must write plain text url in travis.yml?

--- update I use after_success with curl -X POST $URL now, it looks better.

rohngonnarock commented 7 years ago

When I try to use Travis Environment variable which has url in it then it breaks the build.

databaseURL = "https://example.com"

  The command "sed -i "s/EnvdatabaseURL/$databaseURL/g" src/app/config/config.ts" failed and exited with 1 during .