pagerduty_dashing
pagerduty_dashing copied to clipboard
pagerduty with no heroku/rails?
Looking at the code, I am thinking that pagerduty_dashing won't work with regular sinatra Dashing. My team doesn't have or use Heroku, and of the widgets we've deployed, are for sinatra.
Prior to converting this over to run on Heroku, I ran this on a server for over a year so it is doable. Lemme look T this again, it's been a while. :)
I certainly appreciate it. I’ve been trying to work out how we were going to setup a heroku server and setup a dashing-rails in addition to a sinatra server, and on and on and on. This would be great help.
-Jeremy Tweedy
On Jan 22, 2016, at 5:36 PM, Matthew Green <[email protected]mailto:[email protected]> wrote:
Prior to converting this over to run on Heroku, I ran this on a server for over a year so it is doable. Lemme look T this again, it's been a while. :)
— Reply to this email directly or view it on GitHubhttps://github.com/thegreenrobot/pagerduty_dashing/issues/25#issuecomment-174087843.
Have you had any success in finding the local server code? I'd like to be able to run this directly from regular sinatra dashing. Thanks!
Hi there, thanks for reaching out.
So this works out of the box with no additional magic. To get pagerduty_dashing running locally you just need to set the PagerDuty environment variables.
$ cat environment.sh
#!/bin/bash
export PAGERDUTY_URL='https://yourname.pagerduty.com'
export PAGERDUTY_APIKEY='insert_api_key_here'
export PAGERDUTY_SERVICES='{"services": { "staging": "ZZZZZZ","preprod": "BBBBBB","production": "PPPPPP"}}'
export PAGERDUTY_SCHEDULES='{"schedules": { "oncall": "CCCCCC","firefighter": "EEEEEE"}}'
$ source environment.sh
$ dashing start
Thin web server (v1.6.4 codename Gob Bluth)
Maximum connections set to 1024
Listening on 0.0.0.0:3030, CTRL+C to stop
127.0.0.1 - - [09/Apr/2016 15:00:57] "GET /pagerduty HTTP/1.1" 200 3043 0.0026
127.0.0.1 - - [09/Apr/2016 15:00:57] "GET /events HTTP/1.1" 200 - 1.6717
127.0.0.1 - - [09/Apr/2016 15:00:59] "GET /views/text.html HTTP/1.1" 200 175 0.0007
127.0.0.1 - - [09/Apr/2016 15:00:59] "GET /views/hotness.html HTTP/1.1" 200 192 0.0006
( if dashing start doesn't work, alternatively you could use rackup -p 3030 -s webrick )
Open a new tab in your browser and navigate to http://localhost:3030