Skip to content

Commit

Permalink
Merge 9f46d5d into c4f3f45
Browse files Browse the repository at this point in the history
  • Loading branch information
sukrit007 committed Apr 19, 2016
2 parents c4f3f45 + 9f46d5d commit 68665dd
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 119 deletions.
2 changes: 1 addition & 1 deletion orchestrator/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from celery.signals import setup_logging
import orchestrator.logger

__version__ = '0.4.2'
__version__ = '0.4.3'
__author__ = 'sukrit'

orchestrator.logger.init_logging()
Expand Down
166 changes: 50 additions & 116 deletions orchestrator/templates/hipchat.html
Original file line number Diff line number Diff line change
@@ -1,116 +1,50 @@
<table>
<tr>
<td colspan="2"><b>Totem ({{ctx.env}} :: Orchestrator :: {{ctx.operation}})</b><br/></td>
</tr>


<tr>
<td>
<table>
{% if notification.code %}
<tr>
<td valign="top"><b>Code:</b></td>
<td valign="bottom">{{ notification.code }}</td>
</tr>
{% endif %}

{% if notification.message %}
<tr>
<td valign="top"><b>Message:</b></td>
<td valign="bottom">{{ notification.message | truncate(1000) }}
{% if notification.code == 'CONFIG_VALIDATION_ERROR' %}
<a href="https://github.com/totem/cluster-orchestrator/blob/master/schemas/job-config-v1.json"> Click here to view the job-config-v1 schema.</a>
{% endif %}
</td>
</tr>
{% endif %}

{% if ctx.repo %}
<tr>
<td valign="top"><b>Repository:</b></td>

<td valign="bottom">
{% if ctx.github %}
<a href="https://github.com/{{ctx.owner}}/{{ctx.repo}}">{{ ctx.repo }}</a>
{% else %}
{{ ctx.repo }}
{% endif %}
</td>

</tr>
{% endif %}

{% if ctx.owner %}
<tr >
<td valign="top"><b>Owner:</b></td>

<td valign="bottom">
{% if ctx.github %}
<a href="https://github.com/{{ctx.owner}}">{{ ctx.owner }}</a>
{% else %}
{{ ctx.owner }}
{% endif %}
</td>

</tr>
{% endif %}

{% if ctx.commit %}
<tr>
<td valign="top"><b>Commit:</b></td>

<td valign="bottom">
{% if ctx.github %}
<a href="https://github.com/{{ctx.owner}}/{{ctx.repo}}/commit/{{ctx.commit}}">{{ ctx.commit }}</a>
{% else %}
{{ ctx.commit }}
{% endif %}
</td>

</tr>
{% endif %}

{% if ctx.ref %}
<tr>
<td valign="top"><b>Ref:</b></td>

<td valign="bottom">
{% if ctx.github %}
<a href="https://github.com/{{ctx.owner}}/{{ctx.repo}}/tree/{{ctx.ref}}">{{ ctx.ref }}</a>
{% else %}
{{ ctx.ref }}
{% endif %}
</td>

</tr>
{% endif %}

{% if ctx['job-id'] %}
<tr>
<td valign="top"><b>Job-ID:</b></td>

<td valign="bottom">
{{ ctx['job-id'] }}
</td>

</tr>
{% endif %}
</table>

</td>
<td valign="top">
{% if notification.code == 'INTERNAL' %}
<img src='http://cdn.meme.am/instances/500x/56167084.jpg' height='200'/>
{% elif level == 1 %}
<img src='http://i.imgur.com/txw2K6j.jpg' height='200'/>
{% elif level == 2 %}
<img src="http://i.imgur.com/zknV7Dr.jpg" height='200'/>
{% else %}
&nbsp;
{% endif %}
</td>
</tr>



</table>
<b>{{ctx.env}} Orchestrator ({{ctx.operation}}) : </b>
{% if ctx.owner %}
{% if ctx.github %}
<a href="https://github.com/{{ctx.owner}}">{{ ctx.owner }}</a>
{% else %}
{{ ctx.owner }}
{% endif %}
/
{% endif %}

{% if ctx.repo %}
{% if ctx.github %}
<a href="https://github.com/{{ctx.owner}}/{{ctx.repo}}">{{ ctx.repo }}</a>
{% else %}
{{ ctx.repo }}
{% endif %}
/
{% endif %}

{% if ctx.ref %}
{% if ctx.github %}
<a href="https://github.com/{{ctx.owner}}/{{ctx.repo}}/tree/{{ctx.ref}}">{{ ctx.ref }}</a>
{% else %}
{{ ctx.ref }}
{% endif %}
/
{% endif %}

{% if ctx.commit %}
{% if ctx.github %}
<a href="https://github.com/{{ctx.owner}}/{{ctx.repo}}/commit/{{ctx.commit}}">{{ ctx.commit }}</a>
{% else %}
{{ ctx.commit }}
{% endif %}
{% endif %}
:
{% if notification.code %}
(<b>{{ notification.code }}</b>)
{% endif %}

{% if notification.message %}
{{ notification.message | truncate(1000) }}
{% if notification.code == 'CONFIG_VALIDATION_ERROR' %}
<a href="https://github.com/totem/cluster-orchestrator/blob/master/schemas/job-config-v1.json"> Click here to view the job-config-v1 schema.</a>
{% endif %}
{% endif %}

{% if ctx['job-id'] %}
(job-id: {{ ctx['job-id'] }} )
{% endif %}
4 changes: 2 additions & 2 deletions schemas/job-config-v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -481,8 +481,8 @@
"description": "Color mapping"
},
"room": {
"type": "string",
"description": "Room to be used for notification"
"description": "Room to be used for notification",
"$ref": "#/definitions/string-or-template-type"
},
"token": {
"description": "Hipchat API v2 token (personal/ room) for notification",
Expand Down

0 comments on commit 68665dd

Please sign in to comment.