cloudfoundry-community / slack-notification-resource

Concourse CI resource for sending notifications to Slack.
MIT License
75 stars 81 forks source link

env_file variables not loading into slack notification properly #71

Closed RyanKramer closed 5 years ago

RyanKramer commented 5 years ago

Hello,

There seems to be an issue with loading variables from env_file into the slack notification. I had some help from @eedwards-sk through concourse need-help room and he independently verified that it was not working as expected. Currently envsubst works properly but does not get loaded into the notification.

Full discussion can be found on Concourse - #need-help June 7th (~3pm EST till EOD)

riker09 commented 5 years ago

Maybe it has something to do with fact that the image at the Docker hub was updated a year ago?

I am currently trying to figure out why I cannot use values from my env_file in the text parameter. I hijacked the resources container of my slack notification and looked at the tests. There is no test specified that covers env_file, contrary to the tests I ran on my local machine after cloning this repo.

riker09 commented 5 years ago

I can indeed confirm that his is due to the outdated image on the Docker hub. I have build the resource myself and uploaded it to my private Docker registry, configured my slack-notification-resource to use my image and voilá! The environment variables are substitued as intended.

slack-resource-env-vars

Here SchemaService and staging (before "swarm") were replaced from this template:

      text: |
        Deploy of service *`$SERVICE_NAME`* to $SWARM_NAME swarm succeeded.
jhunt commented 5 years ago

Do we just need to build and push a new image from master?

riker09 commented 5 years ago

This is what I did. 🤷‍♂

jhunt commented 5 years ago

1.5.0 is out: https://github.com/cloudfoundry-community/slack-notification-resource/releases/tag/v1.5.0 (and tagged as :latest)

RyanKramer commented 5 years ago

This looks like it is working as expected now. Thank you so much for the help!!