Skip to content

Commit

Permalink
Merge pull request #37 from modcloth/add-newrelic-deployments
Browse files Browse the repository at this point in the history
Optionally notify NewRelic during deployments
  • Loading branch information
Rafe Colton committed Oct 6, 2014
2 parents 6ed3d2d + 8dc0f7e commit 108bb7a
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,28 @@ modcloth_app_cron_logrotate_template: cron-logrotate.j2
# additional conditions on the upstart service
modcloth_app_upstart_start_condition: ""

# Name of the application in NewRelic (for deployment notifications)
modcloth_app_new_relic_app_name: "[{{env}}] {{modcloth_app_name}}"

# Template used for the file written to /etc/init/{{ modcloth_app_name }}.conf
modcloth_app_upstart_conf_template: upstart.conf.j2

# Whether to notify NewRelic of app deployments
modcloth_app_notify_new_relic: false

# External dependency variables

# Github API token
github_token: "{{ github_api_token | default('') }}"

# HipChat API token
hipchat_token: "{{ hipchat_api_token | default('') }}"

# HipChat room id
hipchat_room: "{{ hipchat_team_room | default('') }}"

# NewRelic API token (for deployment notifications)
new_relic_api_token: "{{ new_relic_api_token | default('') }}"
```
## License
Expand Down
9 changes: 9 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ modcloth_app_upstart_conf_template: upstart.conf.j2
# Name of the organism running the playbook
modcloth_app_deployer: ""

# Name of the application in NewRelic (for deployment notifications)
modcloth_app_new_relic_app_name: "[{{env}}] {{modcloth_app_name}}"

# Whether to notify NewRelic of app deployments
modcloth_app_notify_new_relic: false

# External dependency variables

# Github API token
Expand All @@ -85,3 +91,6 @@ hipchat_token: "{{ hipchat_api_token | default('') }}"

# HipChat room id
hipchat_room: "{{ hipchat_team_room | default('') }}"

# NewRelic API token (for deployment notifications)
new_relic_api_token: "{{ new_relic_api_token | default('') }}"
11 changes: 11 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,14 @@
when: hipchat_token != "" and hipchat_room != ""
ignore_errors: yes
run_once: yes

- name: notify new relic deploy complete
sudo: false
newrelic_deployment:
token="{{new_relic_api_token}}"
app_name="{{modcloth_app_new_relic_app_name}}"
revision="{{modcloth_app_docker_tag}}"
user="{{modcloth_app_deployer}}"
when: modcloth_app_notify_new_relic|bool
ignore_errors: True
run_once: yes

0 comments on commit 108bb7a

Please sign in to comment.