Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Add {staging,production} log2viz commands #141

Closed
wants to merge 1 commit into from

3 participants

Dan Croak Mike Burns Joe Ferris
Dan Croak
Owner

No description provided.

Mike Burns
Owner

That deployment_environment.rb script is becoming exciting. Can we extract this into a separate program, or PRs against Heroku?

Dan Croak
Owner

@mike-burns I just took a stab at extracting a few commands into a sub here:

https://github.com/thoughtbot/bot

Let me know what you think. /cc @jferris

Mike Burns
Owner

Cool, interesting direction. Though, how about making bot easier to install (gem install bot, or brew install bot) by pushing the completion and ZSH profile stuff into dotfiles?

Joe Ferris
Owner

This is definitely interesting, and I've wanted to play with sub for a while. I have a couple concerns, though:

  • It seems like this will be come another junk drawer repo, where we put random stuff we find useful. For example, the churn subcommand isn't related at all to the staging subcommand. There's no cohesion to the toolset.
  • I'd like to try and take the more official avenue more often. For example, we recently moved our spec running Vim setup out of the junk drawer and into an actual Vim plugin. Can we make Heroku plugins or something?
Dan Croak
Owner
croaky commented

It seems like this will be come another junk drawer repo ... That deployment_environment.rb script is becoming exciting. Can we extract this into a separate program

Yes, I just extracted it to https://github.com/croaky/parity.

churn subcommand isn't related at all to the staging subcommand. There's no cohesion to the toolset.

The cohesive bits are the development/staging/production parity bits, including restoring backups from one environment to another. I'll submit another pull request to this repo removing them from dotfiles.

Dan Croak croaky closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Apr 15, 2013
Dan Croak croaky Add {staging,production} log2viz commands e97fdd9
This page is out of date. Refresh to see the latest.
12 bin/deployment_environment.rb
@@ -10,6 +10,8 @@ def run
10 10 system "heroku pgbackups:capture --expire --remote #{@environment}"
11 11 when 'console'
12 12 system "heroku run console --remote #{@environment}"
  13 + when 'log2viz'
  14 + system "open https://log2viz.herokuapp.com/app/#{heroku_app_name}"
13 15 when 'migrate'
14 16 system %{
15 17 heroku run rake db:migrate --remote #{@environment} &&
@@ -21,4 +23,14 @@ def run
21 23 system "heroku #{@subcommands.join(' ')} --remote #{@environment}"
22 24 end
23 25 end
  26 +
  27 + private
  28 +
  29 + def heroku_app_name
  30 + [app_name, @environment].join('-')
  31 + end
  32 +
  33 + def app_name
  34 + Dir.pwd.split('/').last
  35 + end
24 36 end
1  bin/production
@@ -4,6 +4,7 @@
4 4 #
5 5 # production backup
6 6 # production console
  7 +# production log2viz
7 8 # production migrate
8 9 # production tail
9 10 #
1  bin/staging
@@ -4,6 +4,7 @@
4 4 #
5 5 # staging backup
6 6 # staging console
  7 +# staging log2viz
7 8 # staging migrate
8 9 # staging tail
9 10 #

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.