Environment variable SLACK_WEBHOOK_URL not passed to `bundle exec`
Closed this issue ยท 4 comments
This broke as of 0.3.2.
cd $WERCKER_SOURCE_DIR
$ export WERCKER_STEP_ROOT="/wercker/steps/wantedly/pretty-slack-notify/0.3.2"
$ export WERCKER_STEP_ID="04d5f687-86a6-41a0-a424-c2842e4eae39"
$ export WERCKER_STEP_NAME="pretty-slack-notify"
$ export WERCKER_REPORT_NUMBERS_FILE="$WERCKER_REPORT_DIR/$WERCKER_STEP_ID/numbers.ini"
$ export WERCKER_REPORT_MESSAGE_FILE="$WERCKER_REPORT_DIR/$WERCKER_STEP_ID/message.txt"
$ export WERCKER_REPORT_ARTIFACTS_DIR="$WERCKER_REPORT_DIR/$WERCKER_STEP_ID/artifacts"
$ mkdir -p $WERCKER_REPORT_ARTIFACTS_DIR
$ export WERCKER_STEP_TEMP="/tmp/$WERCKER_STEP_ID"
$ source '/wercker/wercker-build-essentials/init.sh'
$ mkdir -p $WERCKER_STEP_TEMP
$ export WERCKER_PRETTY_SLACK_NOTIFY_WEBHOOK_URL="$SLACK_WEBHOOK_URL"
$ source "$WERCKER_STEP_ROOT/run.sh"
Ruby Version: ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]
Ruby Path: /usr/bin/ruby
Install User: ubuntu
Fetching: bundler-1.13.6.gem (100%)
Successfully installed bundler-1.13.6
1 gem installed
Installing ri documentation for bundler-1.13.6...
Installing RDoc documentation for bundler-1.13.6...
Installing slack-notifier as root...
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
Fetching gem metadata from https://rubygems.org/..............
Fetching version metadata from https://rubygems.org/.
Rubygems 1.8.11 is not threadsafe, so your gems will be installed one at a time. Upgrade to Rubygems 2.1.0 or higher to enable parallel gem installation.
Installing slack-notifier 1.5.1
Using bundler 1.13.6
Bundle complete! 1 Gemfile dependency, 2 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
Please specify the your slack webhook url```
@sgp Thank you for reporting.
Could you show me your wercker.yml
? I might be able to help you.
@spesnova I already worked around this by using wantedly/pretty-slack-notify@0.3.1
. Is there something else you'd like to tell me about? ๐
(I've redacted bits from our wercker.yml
that are a bit sensitive, but you should get the gist.)
box: ewtroan-pendo/goae@0.4.1
# Build definition
build:
# The steps that will be executed on build
steps:
- script:
name: do stuff
code: |
# [REDACTED]
after-steps:
- wantedly/pretty-slack-notify@0.3.1:
webhook_url: $SLACK_WEBHOOK_URL
deploy:
steps:
- script:
name: do stuff
code: |
# [REDACTED]
after-steps:
- wantedly/pretty-slack-notify@0.3.1:
webhook_url: $SLACK_WEBHOOK_URL
Thank you for sharing it to me ๐
I already worked around this by using wantedly/pretty-slack-notify@0.3.1.
That's good to hear
Is there something else you'd like to tell me about?
Perhaps I found the root cause why 0.3.2 doesn't work for you and 0.3.1 works.
I think this line's sudo
is the root cause:
https://github.com/wantedly/step-pretty-slack-notify/blob/master/run.sh#L34
Because environment variables are not passed when using sudo
,
This issue will be fixed in next release. As I don't use wercker on my work actively nowadays, I won't be able to find this bug if nobody reports. So I'd like to say thank you for reporting again ๐