The Sidekiq based Travis background job processor.
Switch branches/tags
deploy.2014-10-18.17-24 deploy.2014-10-17.19-48 deploy.2014-10-12.16-06 deploy.2014-10-12.15-40 deploy.2014-10-08.13-35 deploy.2014-10-08.13-26 deploy.2014-05-02.12-45 deploy.2014-04-30.20-38 deploy.2014-04-30.06-30 deploy.2014-04-17.12-45 deploy.2014-04-16.02-06 deploy.2014-04-10.14-02 deploy.2014-04-10.10-36 deploy.2014-04-10.10-09 deploy.2014-04-10.10-06 deploy.2014-04-10.09-32 deploy.2014-04-03.09-01 deploy.2014-04-01.14-32 deploy.2014-03-14.09-34 deploy.2014-03-13.16-47 deploy.2014-03-13.06-41 deploy.2014-03-12.08-37 deploy.2014-03-06.15-10 deploy.2014-03-06.14-09 deploy.2014-02-14.13-16 deploy.2013-11-08.10-56 deploy.2013-10-16.23-45 deploy.2013-10-11.18-29 deploy.2013-10-07.13-53 deploy.2013-10-07.12-48 deploy.2013-10-07.12-44 deploy.2013-10-07.12-37 deploy.2013-10-07.12-19 deploy.2013-09-23.10-20 deploy.2013-09-18.12-05 deploy.2013-09-04.12-24 deploy.2013-09-04.11-29 deploy.2013-08-29.09-43 deploy.2013-07-26.18-33 deploy.2013-07-23.15-33 deploy.2013-07-14.15-53 deploy.2013-06-29.21-26 deploy.2013-06-29.16-45 deploy.2013-06-07.15-48 deploy.2013-05-23.10-19 deploy.2013-05-23.08-55 deploy.2013-05-22.13-02 deploy.2013-05-20.15-21 deploy.2013-05-20.13-44 deploy.2013-05-19.10-33 deploy.2013-05-16.19-44 deploy.2013-05-14.10-24 deploy.2013-05-07.15-22 deploy.2013-03-28.16-50 deploy.2013-03-28.16-16 deploy.2013-03-25.12-15 deploy.2013-02-04.14-50 deploy.2013-02-04.13-50 deploy.2013-01-30.16-01 deploy.2013-01-30.11-49 deploy.2013-01-30.11-14 deploy.2013-01-29.23-08 deploy.2013-01-20.02-01 deploy.2013-01-20.01-56 deploy.2012-12-10.12-41 deploy.2012-11-29.14-12 deploy.2012-11-19.13-11 deploy.2012-11-19.13-03 deploy.2012-11-07.06-37 deploy.2012-11-02.16-37 deploy.2012-10-31.22-14
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

README.md

Travis Tasks


Travis Task is a Sidekiq based background processor whose main job is to send all manner of notifications based on events within Travis (job started, build finished).

These notifications are all queued up by state changes which are processed by Travis Hub and Travis Gatekeeper.

And, to make Travis Tasks even more special, there is no database connection required! Travis Tasks is all about talking to 3rd party services, if it be, Mandrill, Campfire, Slack, or Pushover.

You can find the full list of addon services Travis natively talks to within Travis Core.

Travis Tasks Diagram

Sending Email Setup

Start an Interactive Ruby Shell

irb -Ilib -rtravis/tasks

Setup Config for SMTP By Running Each Command

Travis.config.smtp.address = 'smtp.mandrillapp.com'
Travis.config.smtp.domain = 'travis-ci.org'
Travis.config.smtp.enable_starttls_auto = true
Travis.config.smtp.password = 'your smtp password for your enviorment'
Travis.config.smtp.port = 587
Travis.config.smtp.user_name = 'your smtp username'

Send Build Emails

To send diffent types of build emails the state, previous_state attributes in the build hash and state attribute job hash will need to be modified

You can send email to multiple addresses by adding them to the array following the jobs hash

Success Build

Travis::Addons::Email::Mailer::Build.finished_email({ build: {id: 1, repository_id: 1, commit_id: 1, number: 2, pull_request: false, config: {rvm: ['1.8.7, 1.9.2']}, state: 'passed', previous_state: 'passed', started_at: '2014-04-03T10:21:05Z', finished_at: '2014-04-03T10:22:05Z', duration: 60, jobs_ids: [1, 2], type: 'push'}, repository: {id: 1, key: '-----BEGIN PUBLIC KEY-----', slug: 'wonderfulPerson/minimal', name: 'minimal', owner_name: 'wonderPerson', owner_email: 'someone@internet.com', owner_avatar_url: nil, url: 'repo url here}, commit: {id: 1, sha: '62aae5f70ceee39123ef', branch: 'this-branch-is-awesome', message: 'the commit message', committed_at: '2014-04-03T09:22:05Z', author_name: 'Wonderful Person', author_email: 'someone@internet.com', committer_name: 'Wonderful Person', committer_email: 'someone@internet.com', compare_url: 'https://github.com/wonderfulperson/minimal/compare/master...develop'}, jobs: [{id: 1, number: '2.1', state: 'passed', config: {rvm: '1.8.7'}}]},['recipient@internet.com'],[{message: 'Testing testing this is a message', category: 'announcement'}, {message: 'Testing testing this is a message', category: 'warning'}]).deliver

Failed Build

Travis::Addons::Email::Mailer::Build.finished_email({ build: {id: 1, repository_id: 1, commit_id: 1, number: 2, pull_request: false, config: {rvm: ['1.8.7, 1.9.2']}, state: 'failed', previous_state: 'passed', started_at: '2014-04-03T10:21:05Z', finished_at: '2014-04-03T10:22:05Z', duration: 60, jobs_ids: [1, 2], type: 'push'}, repository: {id: 1, key: '-----BEGIN PUBLIC KEY-----', slug: 'wonderfulPerson/minimal', name: 'minimal', owner_name: 'wonderPerson', owner_email: 'someone@internet.com', owner_avatar_url: nil, url: 'repo url here}, commit: {id: 1, sha: '62aae5f70ceee39123ef', branch: 'this-branch-is-awesome', message: 'the commit message', committed_at: '2014-04-03T09:22:05Z', author_name: 'Wonderful Person', author_email: 'someone@internet.com', committer_name: 'Wonderful Person', committer_email: 'someone@internet.com', compare_url: 'https://github.com/wonderfulperson/minimal/compare/master...develop'}, jobs: [{id: 1, number: '2.1', state: 'failed', config: {rvm: '1.8.7'}}]},['recipient@internet.com'],[{message: 'Testing testing this is a message', category: 'announcement'}, {message: 'Testing testing this is a message', category: 'warning'}]).deliver

Still Failing Build

Travis::Addons::Email::Mailer::Build.finished_email({ build: {id: 1, repository_id: 1, commit_id: 1, number: 2, pull_request: false, config: {rvm: ['1.8.7, 1.9.2']}, state: 'failed', previous_state: 'failed', started_at: '2014-04-03T10:21:05Z', finished_at: '2014-04-03T10:22:05Z', duration: 60, jobs_ids: [1, 2], type: 'push'}, repository: {id: 1, key: '-----BEGIN PUBLIC KEY-----', slug: 'wonderfulPerson/minimal', name: 'minimal', owner_name: 'wonderPerson', owner_email: 'someone@internet.com', owner_avatar_url: nil, url: 'repo url here}, commit: {id: 1, sha: '62aae5f70ceee39123ef', branch: 'this-branch-is-awesome', message: 'the commit message', committed_at: '2014-04-03T09:22:05Z', author_name: 'Wonderful Person', author_email: 'someone@internet.com', committer_name: 'Wonderful Person', committer_email: 'someone@internet.com', compare_url: 'https://github.com/wonderfulperson/minimal/compare/master...develop'}, jobs: [{id: 1, number: '2.1', state: 'failed', config: {rvm: '1.8.7'}}]},['recipient@internet.com'],[{message: 'Testing testing this is a message', category: 'announcement'}, {message: 'Testing testing this is a message', category: 'warning'}]).deliver

Error Build

Travis::Addons::Email::Mailer::Build.finished_email({ build: {id: 1, repository_id: 1, commit_id: 1, number: 2, pull_request: false, config: {rvm: ['1.8.7, 1.9.2']}, state: 'errored', previous_state: 'passed', started_at: '2014-04-03T10:21:05Z', finished_at: '2014-04-03T10:22:05Z', duration: 60, jobs_ids: [1, 2], type: 'push'}, repository: {id: 1, key: '-----BEGIN PUBLIC KEY-----', slug: 'wonderfulPerson/minimal', name: 'minimal', owner_name: 'wonderPerson', owner_email: 'someone@internet.com', owner_avatar_url: nil, url: 'repo url here}, commit: {id: 1, sha: '62aae5f70ceee39123ef', branch: 'this-branch-is-awesome', message: 'the commit message', committed_at: '2014-04-03T09:22:05Z', author_name: 'Wonderful Person', author_email: 'someone@internet.com', committer_name: 'Wonderful Person', committer_email: 'someone@internet.com', compare_url: 'https://github.com/wonderfulperson/minimal/compare/master...develop'}, jobs: [{id: 1, number: '2.1', state: 'errored', config: {rvm: '1.8.7'}}]},['recipient@internet.com'],[{message: 'Testing testing this is a message', category: 'announcement'}, {message: 'Testing testing this is a message', category: 'warning'}]).deliver

Send Trial Emails

Travis::Addons::Trial::Mailer::TrialMailer.trial_started(%w{your_email@address.com}, { name: 'Clark', login: 'github_username', billing_slug: 'user' }, 100).deliver

Send Billing Emails

When a charge failed we call this method: charge_failed(receivers, subscription, owner, charge, event, invoice, cc_last_digits)

To check it and receive an email:

Travis::Addons::Billing::Mailer::BillingMailer.charge_failed( ["your_email@address.com"], { first_name: "Firstname", last_name: "Lastname", company: "Org", selected_plan: "travis-ci-two-builds"}, { name: 'Name', login: 'login' }, {"object": "charge"}, { "object": "invoice", "paid": false, "next_payment_attempt": Time.now + 86400.to_i  }, {"object": "invoice"}, {cc_last_digest: 1234}).deliver

We have the similar methods for: invoice_payment_succeeded and subscription_cancelled.

Send Feedback Emails

When a user gives feedback after the cancellation that method gets called :user_feedback(recipients, subscription, owner, user, feedback)

To check it and receive an email at: success@travis-ci.org:

Travis::Addons::BillingFeedback::Mailer::BillingFeedbackMailer.user_feedback( ["your_email@address.com"], {first_name: "Firstname", last_name: "Lastname", company: "Org", selected_plan: "travis-ci-two-builds", valid_to: Time.now }, { name: 'Name', login: 'login' }, {name: 'user', login: 'userlogin', email: "your_email@address.com" }, {"feedback": "test"}).deliver

Reporting Issues

Please file any issues on the central Travis CI issue tracker.

License & copyright information

See LICENSE file.

Copyright (c) 2011 Travis CI development team.