forked from poma/docker-telegram-notifier
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtemplates.js
15 lines (11 loc) · 1014 Bytes
/
templates.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
const utils = require('./utils');
module.exports = {
container_start: e =>
`<b>Host:</b> ${utils.getEnvVar("DOCKER_HOSTNAME")}\n<b>IP:</b> ${utils.getEnvVar("DOCKER_IP_ADDRESS")}\n<b>Container:</b> ${e.Actor.Attributes.name}\n<b>Image:</b> ${e.Actor.Attributes.image}\n<b>Has been started</b>`,
container_die: e =>
`<b>Host:</b> ${utils.getEnvVar("DOCKER_HOSTNAME")}\n<b>IP:</b> ${utils.getEnvVar("DOCKER_IP_ADDRESS")}\n<b>Container:</b> ${e.Actor.Attributes.name}\n<b>Image:</b> ${e.Actor.Attributes.image}\n<b>Has been stopped</b>\n<b>Exit Code:</b> ${e.Actor.Attributes.exitCode}`,
'container_health_status: healthy': e =>
`Status <b>Healthy</b> for <b>${e.Actor.Attributes.name}</b> at ${utils.getEnvVar("DOCKER_HOSTNAME")}@${utils.getEnvVar("DOCKER_IP_ADDRESS")}`,
'container_health_status: unhealthy': e =>
`Status <b>Unhealthy</b> for <b>${e.Actor.Attributes.name}</b> at ${utils.getEnvVar("DOCKER_HOSTNAME")}@${utils.getEnvVar("DOCKER_IP_ADDRESS")}`,
};