Skip to content

Instantly share code, notes, and snippets.

@jmervine
Created March 21, 2016 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmervine/7c438c8fcb5aa0adb6b6 to your computer and use it in GitHub Desktop.
Save jmervine/7c438c8fcb5aa0adb6b6 to your computer and use it in GitHub Desktop.

Status: New

Notes on building out a new instance of stats.heroku.com on the platform.

heroku create --space sre-oregon --org heroku-sre --region oregon status-integration

# addons
heroku addons:create memcachier:100 -a status-integration
heroku addons:create pusher:startup -a status-integration
heroku addons:create sendgrid:bronze -a status-integration
heroku addons:create heroku-postgresql:standard-0 -a status-integration

# todo: mailgun, using status-simulation for now
heroku config:set -a status-integration \
	`heroku config -s -a status-simulation | grep MAILGUN | xargs`

# other configs, also from status-simulation

## twitter
heroku config:set -a status-integration \
	`heroku config -s -a status-simulation | grep TWITTER | xargs`

## twilio
heroku config:set -a status-integration \
	`heroku config -s -a status-simulation | grep TWILIO | xargs`

## hipchat
heroku config:set -a status-integration HIPCHAT_NOTIFY='@here'
heroku config:set -a status-integration HIPCHAT_ROOMS=SRE-Bots
heroku config:set -a status-integration HIPCHAT_SERVER=https://hipchat.itops.herokai.com
heroku config:set -a status-integration HIPCHAT_TOKEN=e673176455fcc0b9985b74158c6b3d
heroku config:set -a status-integration HIPCHAT_USER="Status Integration"

# hostname
heroku config:set -a status-integration HOSTNAME=status-integration.heroku.com

# environment
heroku config:set -a status-integration RAILS_ENV=production
heroku config:set -a status-integration RACK_ENV=production

# google
heroku config:set -a status-integration GOOGLE_DOMAIN=heroku.com
heroku config:set -a status-integration GOOGLE_CLIENT_ID=<SHHHHH DON'T TELL>
heroku config:set -a status-integration GOOGLE_CLIENT_SECRET=<SHHHHH DON'T TELL>

# secret
heroku config:set -a status-integration \
	SECRET_TOKEN=`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 40 | head -n 1`

# others
heroku config:set -a status-integration NOTIFICATION_EMAILS=sre-team-only@heroku.com

## deploy
git push heroku master

## migrations
heroku run -a status-integration rake db:migrate

## check cache setup
heroku run -a status-integration rake cache:flush

## generate cert
openssl genrsa -des3 -passout pass:x -out server.pass.key 2048
openssl rsa -passin pass:x -in server.pass.key -out server.key
rm server.pass.key
openssl req -new -key server.key -out server.csr
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt

heroku addons:create ssl:endpoint -a status-integration
 !    ssl is not available in any region for spaces.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment