Skip to content
This repository was archived by the owner on Apr 26, 2020. It is now read-only.

Commit 73a3aee

Browse files
committed
Merge pull request #29 from temp/hipchat-instance
Make hipchat API endpoint configurable
2 parents 7322ae1 + c7ce71e commit 73a3aee

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

docs/hipchat.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ You can provide also other configuration options:
2020
- *message* - Deploy message, default is **Deployment to '{$host}' on *{$prod}* was successful\n({$releasePath})**
2121
- *color* - Message color, default is **green**
2222
- *notify* - Notify, default is **0**
23-
23+
- *endpoint* - API endpoint, change this if you run your own hipchat instance, default is **https://api.hipchat.com/v1/rooms/message**
2424

2525
```php
2626
// deploy.php

recipes/hipchat.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
'color' => 'green',
3030
'format' => 'json',
3131
'notify' => 0,
32+
'endpoint' => 'https://api.hipchat.com/v1/rooms/message',
3233
];
3334

3435
$config = array_merge($defaultConfig, $config);
@@ -39,6 +40,9 @@
3940
throw new \RuntimeException("Please configure new hipchat: set('hipchat', array('auth_token' => 'xxx', 'room_id' => 'yyy'));");
4041
}
4142

43+
$endpoint = $config['endpoint'];
44+
unset($config['endpoint']);
45+
4246
$urlParams = [
4347
'room_id' => $config['room_id'],
4448
'from' => $config['from'],
@@ -49,7 +53,7 @@
4953
'format' => $config['format'],
5054
];
5155

52-
$url = 'https://api.hipchat.com/v1/rooms/message?' . http_build_query($urlParams);
56+
$url = $endpoint . '?' . http_build_query($urlParams);
5357

5458
$result = @file_get_contents($url);
5559

0 commit comments

Comments
 (0)