The online documentation for Travis-CI notification on Slack says:
Overriding the channel is also possible, just add it to the configuration with a # separating them from account and token.
notifications:
slack: '<account>:<token>#development'
However, if I want to encrypt the credentials the way it is recommended:
travis encrypt "<account>:<token>" --add notifications.slack
will work just fine. But when I try:
travis encrypt "<account>:<token>#development" --add notifications.slack
I get a new encrypted token, but the notifications come on the default channel set up at integration time. What am I doing wrong?
Note: we use enterprise versions of everything (Slack, Travis, GitHub), in case this may play a role.
The command isn't correct, it's missing the .rooms
property at the end. It should be
travis encrypt "account:token#channel" --add notifications.slack.rooms
the encrypt command is correct:
travis encrypt "account:token#channel" --add notifications.slack
but the result inside the .travis.yml will be (wrong, and that's the problem):
notifications:
slack:
secure: xxxxxxxxxxxxxxxxxxxxxx
you have to edit the .travis.yml manually after the encrypt command and add rooms, so correct is:
notifications:
slack:
rooms:
secure: xxxxxxxxxxxxxx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With