wantedly / step-pretty-slack-notify

Posts wercker build/deploy status to a Slack channel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Username does not default to Wercker

drewfranklin opened this issue · comments

In the slack notification the username does not default to Wercker. It looks like environment variable WERCKER_PRETTY_SLACK_NOTIFY_USERNAME is not being defined in script/run, but I am not exactly sure if that is the issue

screen shot 2016-11-29 at 2 26 32 pm

@drewfranklin Thank you for reporting.
Could you show me your wercker.yml ? I might be able to help you.

For sure
box: zdfs/docker-suit
build:
steps:
- npm-install
- script:
name: create empty 'public' and 'deploy' directories
code: |-
mkdir 'public'
mkdir 'deploy'`
- grunt:
tasks: predeploy
- grunt:
tasks: deploy
- script:
name: copy documentation for deployment
code: |-
cp --recursive deploy/* "$WERCKER_OUTPUT_DIR"
- script:
name: echo nodejs information
code: |
echo "node version $(node -v) running"
echo "npm version $(npm -v) running"
after-steps:
- wantedly/pretty-slack-notify:
webhook_url: $SLACK_WEBHOOK_URL
channel: suit
notify_on: "failed"
deploy:
steps:
- duleorlovic/ftp-deploy:
destination: ftp://$HOSTNAME/$FTP_TARGET
username: $FTP_USERNAME
password: $FTP_PASSWORD
after-steps:
- wantedly/pretty-slack-notify:
webhook_url: $SLACK_WEBHOOK_URL
channel: suit
deploy-release:
steps:
- duleorlovic/ftp-deploy:
destination: ftp://$HOSTNAME/$WERCKER_GIT_BRANCH
username: $FTP_USERNAME
password: $FTP_PASSWORD
after-steps:
- wantedly/pretty-slack-notify:
webhook_url: $SLACK_WEBHOOK_URL
channel: suit

Sorry about the formatting but using the code markup makes it one line

@drewfranklin Thank you for sharing it to me.

At first, you might be able to work around by specifying username option like this:

        - wantedly/pretty-slack-notify:
            webhook_url: $SLACK_WEBHOOK_URL
            channel: suit
            username: Wercker

To find the root cause, could you show me "wantedly/pretty-slack-notify" step's log on wercker?

Awesome thanks for the quick fix
Here is my log
screen shot 2016-12-01 at 10 32 51 am

@drewfranklin Thanks! I could find the root cause from your log ❗️
This bug will be fixed in next release 😃
So please use username option to workaround until next version released.

@drewfranklin step-pretty-slack-notify v0.3.4 including the fix of this issue was just released. Please try it.

Yep it worked thanks so much everyone!