Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into add-newrelic-deploy…
Browse files Browse the repository at this point in the history
…ments

Conflicts:
	tasks/main.yml
  • Loading branch information
jszwedko committed Oct 6, 2014
2 parents 451fb8b + ac93071 commit 8dc0f7e
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 6 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ pull docker containers.
modcloth_app_name: app

# The type of application to be deployed, either "long-running" or "cron"
# 'cron' should be used for applications that should run on a schedule (e.g. a rake task)
# A cron entry will be inserted to run this task (as root)
# 'long-running' should be used for applications that behave as services and should always be up
# An upstart job will be created to run your service (as root)
modcloth_app_type: long-running

# Environment variable mapping written to /etc/default/{{ modcloth_app_name }}
Expand Down
4 changes: 4 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
modcloth_app_name: app

# The type of application to be deployed, either "long-running" or "cron"
# 'cron' should be used for applications that should run on a schedule (e.g. a rake task)
# A cron entry will be inserted to run this task (as root)
# 'long-running' should be used for applications that behave as services and should always be up
# An upstart job will be created to run your service (as root)
modcloth_app_type: long-running

# Environment variable mapping written to /etc/default/{{ modcloth_app_name }}
Expand Down
2 changes: 2 additions & 0 deletions example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@
modcloth_app_docker_volumes:
- { host: /var/log/foo, container: /var/logfoo, permissions: ro }

# To be used with applications that should run on a schedule (e.g. a rake task)
- role: modcloth.app
modcloth_app_name: modcloth-cron-app
modcloth_app_type: cron
modcloth_app_docker_args:
- '--link memcached:memcached'
modcloth_app_docker_command: date
modcloth_app_cron_schedule: '*/5 * * * *'
modcloth_app_docker_repo: busybox
modcloth_app_cron_stdin_command: date
modcloth_app_env:
Expand Down
16 changes: 11 additions & 5 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,21 @@
mode=0644
changed_when: False
when: hipchat_token != "" and hipchat_room != ""
ignore_errors: True

- name: notify hipchat deploy started
sudo: false
connection: local
hipchat:
token: "{{ hipchat_token }}"
room: "{{ hipchat_room }}"
msg: "{{ lookup('file', modcloth_app_hipchat_html).replace('__ACTION__', 'deploying').replace('__SERVER__', hostname ) }}"
msg: "{{ lookup('file', modcloth_app_hipchat_html).replace('__ACTION__', 'deploying').replace('__NETWORK_ENV__', env ) }}"
msg_format: html
color: purple
color: yellow
changed_when: False
when: hipchat_token != "" and hipchat_room != ""
ignore_errors: True
run_once: yes

- name: write etc default file
template:
Expand Down Expand Up @@ -59,11 +62,13 @@
hipchat:
token: "{{ hipchat_token }}"
room: "{{ hipchat_room }}"
msg: "{{ lookup('file', modcloth_app_hipchat_html).replace('__ACTION__', 'done deploying').replace('__SERVER__', hostname ) }}"
msg: "{{ lookup('file', modcloth_app_hipchat_html).replace('__ACTION__', 'done deploying').replace('__NETWORK_ENV__', env ) }}"
msg_format: html
color: purple
color: green
changed_when: False
when: hipchat_token != "" and hipchat_room != ""
ignore_errors: True
run_once: yes

- name: notify new relic deploy complete
sudo: false
Expand All @@ -73,4 +78,5 @@
revision="{{modcloth_app_docker_tag}}"
user="{{modcloth_app_deployer}}"
when: modcloth_app_notify_new_relic|bool
ignore_errors: yes
ignore_errors: True
run_once: yes
2 changes: 1 addition & 1 deletion templates/hipchat_notification.frag.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
{% else %}
{{ modcloth_app_docker_tag }}
{% endif %}
{{ modcloth_app_tag_annotation }} to __SERVER__
{{ modcloth_app_tag_annotation }} to __NETWORK_ENV__

0 comments on commit 8dc0f7e

Please sign in to comment.