Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into new_config_param
Conflicts: Gemfile.lock
- Loading branch information
Showing
46 changed files
with
422 additions
and
270 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,66 @@ | ||
PATH | ||
remote: . | ||
specs: | ||
iron_worker_ng (0.14.0) | ||
iron_worker_ng (0.15.0) | ||
bundler (>= 1.2.0) | ||
iron_core (>= 0.4.2) | ||
iron_core (>= 0.5.1) | ||
rubyzip (>= 0.9.9) | ||
|
||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
actionmailer (2.3.15) | ||
actionpack (= 2.3.15) | ||
actionpack (2.3.15) | ||
activesupport (= 2.3.15) | ||
rack (~> 1.1.3) | ||
activesupport (2.3.15) | ||
ansi (1.4.3) | ||
builder (3.1.4) | ||
faraday (0.8.4) | ||
multipart-post (~> 1.1) | ||
hashie (1.2.0) | ||
iron_core (0.4.4) | ||
rest (>= 2.1.1) | ||
iron_cache (1.4.0) | ||
iron_core (>= 0.5.1) | ||
iron_core (0.5.1) | ||
rest (>= 2.2.0) | ||
mime-types (1.19) | ||
minitest (4.3.3) | ||
minitest-reporters (0.13.1) | ||
minitest (4.4.0) | ||
minitest-reporters (0.14.3) | ||
ansi | ||
builder | ||
minitest (>= 2.12, < 5.0) | ||
powerbar | ||
multi_json (1.5.0) | ||
multipart-post (1.1.5) | ||
net-http-persistent (2.8) | ||
powerbar (1.0.11) | ||
ansi (~> 1.4.0) | ||
hashie (>= 1.1.0) | ||
rake (10.0.2) | ||
rest (2.1.1) | ||
rack (1.1.5) | ||
rake (10.0.3) | ||
rest (2.2.0) | ||
net-http-persistent | ||
rest-client (>= 0.3.0) | ||
rest-client (1.6.7) | ||
mime-types (>= 1.16) | ||
rubyzip (0.9.9) | ||
simple_oauth (0.2.0) | ||
test-unit (2.5.3) | ||
twitter (4.4.4) | ||
faraday (~> 0.8, < 0.10) | ||
multi_json (~> 1.0) | ||
simple_oauth (~> 0.2) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
actionmailer | ||
iron_cache (>= 1.4.0) | ||
iron_worker_ng! | ||
minitest | ||
minitest-reporters (>= 0.5.0) | ||
rake | ||
test-unit | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# action_mailer example | ||
|
||
This example shows how to send emails in worker. | ||
|
||
1. Be sure you've setup your Iron.io credentials, see main [README.md](https://github.com/iron-io/iron_worker_examples). | ||
2. Copy `actionmailer_config_sample.json` to `actionmailer_config.json` and edit it to set your gmail credentials. | ||
3. Run `iron_worker upload actionmailer_standalone` to upload worker. | ||
4. Run `iron_worker queue actionmailer_standalone --payload-file actionmailer_config.json` | ||
5. Look at [HUD](https://hud.iron.io) to view your tasks running, check logs, etc. | ||
|
||
Read the code in this directory to learn more about what happened. |
8 changes: 8 additions & 0 deletions
8
examples/actionmailer_standalone/actionmailer_config_sample.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"gmail": { | ||
"username": "you@gmail.com", | ||
"password": "yourpwd" | ||
}, | ||
"from": "you@gmail.com", | ||
"to": ["you@gmail.com"] | ||
} |
4 changes: 4 additions & 0 deletions
4
examples/actionmailer_standalone/actionmailer_standalone.worker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
exec 'actionmailer_worker.rb' | ||
file 'mailer.rb' | ||
dir 'mailer' | ||
gem 'actionmailer' |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
# Github Webhook Worker | ||
# Chargify Webhook Worker | ||
|
||
This shows how to kick off a worker from a webhook. This example uses Github's Service Hooks. | ||
This shows how to kick off a worker from a webhook. This example uses Chargify's webhooks. | ||
|
||
## Getting started | ||
1. Be sure you've setup your Iron.io credentials, see main [README.md](https://github.com/iron-io/iron_worker_examples). | ||
1. Copy or rename the campfire_config_example.json to campfire_config.json and edit it to set your campfire credentials. | ||
1. `iron_worker upload chargify_to_campfire` | ||
1. See webhook url `iron_worker webhook chargify_to_campfire` | ||
1. Set it in chargify (Settings -> Webhooks) | ||
1. Select types of events you want to be notified of. | ||
1. Click 'Save Webhook settings' | ||
1. Click 'Send a test Webhook' | ||
1. Check the worker status and logs in IronWorker at http://hud.iron.io to ensure it ran successfully. | ||
1. Check campfire for messages from webhook. | ||
|
||
- Copy or rename the webhook_config_example.yml to webhook_config.yml and edit it to set your hipchat credentials. | ||
- Upload the worker by running `upload.rb` in this directory and follow instruction it prints | ||
- Click Update Settings | ||
- Click Test Hook | ||
- Check the worker status and logs in IronWorker at http://hud.iron.io to ensure it ran successfully. | ||
|
||
That's it, now everytime someone pushes to your github repo, it'll execute the GithubWebhookWorker on IronWorker. | ||
That's it, now you'll be notified about selected chargify events in campfire. |
5 changes: 5 additions & 0 deletions
5
examples/chargify_to_campfire_webhook_worker/campfire_config_sample.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"account": "sample", | ||
"token": "12462462460f3456a3571e0456a7c5845f774674", | ||
"room": "Room 1" | ||
} |
4 changes: 4 additions & 0 deletions
4
examples/chargify_to_campfire_webhook_worker/chargify_to_campfire.worker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
exec 'chargify_to_campfire_webhook_worker.rb' | ||
gem 'broach' | ||
file 'campfire_config.json' | ||
full_remote_build true |
26 changes: 10 additions & 16 deletions
26
examples/chargify_to_campfire_webhook_worker/chargify_to_campfire_webhook_worker.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,21 @@ | ||
require 'cgi' | ||
require 'yaml' | ||
require 'broach' | ||
|
||
# the payload we get from github needs to be decoded first | ||
cgi_parsed = CGI::parse(payload) | ||
puts "cgi_parsed: #{cgi_parsed.inspect}" | ||
|
||
# Then we can parse the json | ||
#parsed = JSON.parse(cgi_parsed) | ||
#puts "parsed: #{parsed.inspect}" | ||
parsed = cgi_parsed # seems to already be in a hash? | ||
event = cgi_parsed["event"][0] | ||
|
||
@event = parsed["event"][0] | ||
|
||
# Also parse the config we uploaded with this worker for our Hipchat stuff | ||
webhook_config = YAML.load_file('webhook_config.yml') | ||
puts "webhook_config: #{webhook_config.inspect}" | ||
|
||
campfire_config = webhook_config['campfire'] | ||
# parse campfire config | ||
cfg = JSON.parse(File.read('campfire_config.json')) | ||
puts "campfire config: #{cfg.inspect}" | ||
|
||
Broach.settings = { | ||
'account' => campfire_config['account'], | ||
'token' => campfire_config['token'], | ||
'use_ssl' => true | ||
'account' => cfg['account'], | ||
'token' => cfg['token'], | ||
'use_ssl' => true | ||
} | ||
Broach.speak(campfire_config['room'], @event) | ||
Broach.speak(cfg['room'], event) | ||
|
||
puts 'Done' |
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
examples/chargify_to_campfire_webhook_worker/webhook_config_example.yml
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
# email_worker | ||
# email_worker example | ||
|
||
This is simple example how to send email using IronWorker | ||
Command line tool reference could be found here - http://dev.iron.io/worker/reference/cli/ | ||
|
||
## Getting started | ||
|
||
- Edit _config.yml (iw and email sections) | ||
- Upload the worker by running 'iron_worker upload email_worker' in this directory | ||
- run 'single_email_sender.rb' | ||
1. Be sure you've setup your Iron.io credentials, see main [README.md](https://github.com/iron-io/iron_worker_examples). | ||
2. Copy `email_config_sample.json` to `email_config.json` and edit it to set your credentials. | ||
3. Run `iron_worker upload email_worker` to upload worker. | ||
4. Run `iron_worker queue email_worker --payload-file email_config.json` | ||
5. Look at [HUD](https://hud.iron.io) to view your tasks running, check logs, etc. | ||
|
||
That's it, now you should receive email. | ||
|
||
Read the code in this directory to learn more about what happened. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"smtp": { | ||
"user_name": "you@gmail.com", | ||
"password": "secret", | ||
"enable_starttls_auto": true, | ||
"authentication": "plain", | ||
"address": "smtp.gmail.com", | ||
"port": 587 | ||
// "address": "smtp.sendgrid.net", | ||
// "port": 25 | ||
}, | ||
|
||
// uncomment and edit to put email details on iron_cache | ||
// "iron": { | ||
// "token": "Et1E98729890283837Fu34L3234", | ||
// "project_id": "523412343249345435342349" | ||
// }, | ||
|
||
// uncomment and edit to send email detail via http api | ||
// "endpoint": "www.myservice.com/api/email_sent", | ||
|
||
"from": "you@gmail.com", | ||
"to": "you@gmail.com", | ||
"subject": "hello from IronWorker", | ||
"body": "hello me" | ||
} |
Oops, something went wrong.