salesforce-bulkapi-notifier notify to slack when failed jobs. e.g. When job state is Failed or Error is higher than Error rate.
Created by gh-md-toc
- Ruby 2.7 or later
- Set enviroments
- this tool run using OAuth username password flow
- Slack API Token
- To integrate your bot with Slack, you must first create a new Slack App.
Add this line to your application's Gemfile:
gem 'salesforce-bulkapi-notifier'
And then execute:
$ bundle
Or install it yourself as:
$ gem install salesforce-bulkapi-notifier
TBD
Please check example code
require 'salesforce-bulkapi-notifier'
SalesforceBulkAPINotifier.configure do |c|
c.slack_api_token = ENV['SLACK_API_TOKEN'] # e.g. xxx-your-token-here
c.slack_channel_name = ENV['SLACK_CHANNEL_NAME'] # Supported multi channel by using `,`. e,g #general,@kou
c.salesforce_host = ENV['SALESFORCE_HOST'] # e.g. example.com
c.salesforce_user_id = ENV['SALESFORCE_USER_ID'] # e.g. your@example.com
c.salesforce_password = ENV['SALESFORCE_PASSWORD'] # e.g. your-password
c.salesforce_client_id = ENV['SALESFORCE_CLIENT_ID'] # e.g. your-client-id
c.salesforce_client_secret = ENV['SALESFORCE_CLIENT_SECRET'] # e.g. your-client-secret
end
SalesforceBulkAPINotifier.execute
error_rate
# default 10interval_seconds
# default 60logger.level
# default debug
After checking out the repo, run bin/setup
to install dependencies. Then, run rake spec
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/koudaiii/salesforce-bulkapi-notifier. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
- Fork (https://github.com/koudaiii/salesforce-bulkapi-notifier/fork)
- Create a feature branch
- Commit your changes
- Rebase your local changes against the master branch
- Run test suite with the
bundle exec rspec
command and confirm that it passes - Create a new Pull Request
The gem is available as open source under the terms of the
Everyone interacting in the Salesforce-bulkapi-notifier project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.