go to heroku.com the site you are upgrading
-
add the new database - we chose 'CRANE' for 50$ / month
heroku addons:add heroku-postgresql:crane
-
in console
heroku pg:wait --remote staging
http://www.rubydoc.info/gems/resque/frames | |
Resque.info | |
{:pending=>0, :processed=>157473, :queues=>7, :workers=>21, :working=>0, :failed=>0, :servers=>["redis://barb.redistogo.com:9497/0"], :environment=>"production"} | |
Resque.workers | |
returns an array of workers available | |
Resque.workers.each {|w| w.prune_dead_workers } | |
kills dead workers | |
w = Resque.workers[0] |
c = ActiveRecord::Base.connection | |
c.tables.collect do |t| | |
columns = c.columns(t).collect(&:name).select {|x| x.ends_with?("_id" || x.ends_with("_type"))} | |
indexed_columns = c.indexes(t).collect(&:columns).flatten.uniq | |
unindexed = columns - indexed_columns | |
unless unindexed.empty? | |
puts "#{t}: #{unindexed.join(", ")}" | |
end | |
end |
module RetryOnTermJob | |
def around_perform_retry_on_term(*args) | |
begin | |
yield *args | |
rescue Exception => e | |
if e.message =~ /SIGTERM/ | |
# when a worker `extend`s this class, self is that worker class | |
Resque.enqueue(self, *args) | |
else | |
raise |
go to heroku.com the site you are upgrading
add the new database - we chose 'CRANE' for 50$ / month
heroku addons:add heroku-postgresql:crane
in console
heroku pg:wait --remote staging
git reset --hard 10123974102937840192374 | |
this moves the pointer to that commit. This is what you want most of the time | |
git reset --soft 0238947293842937429384723 | |
this moves the pointer and via an index that you commit , very strange. | |
git stash | |
stash the last commit | |
git stash apply | |
applies the last stash | |
git stash apply stash@{2} | |
if you want one of the older ones | |
git stash drop with the name of the stash to remove: |
updated in https://gist.github.com/joncode/46ca26a497ee7b9f477a
####Step 1 $ openssl genrsa -des3 -out host.key 2048 you will be asked for a passphrase - very important to store this ####Step 2
1. make a new secret token at the command line | |
rake secret | |
2. set the var in staging and production, run for each | |
heroku config:set SECRET_TOKEN=9813745901y30fhi2304ify1034yf1083y5r013yfr0813gf9 --remote <stagingORproduction> | |
3. remove the secret_token.rb code in favor of the GETTER for ENV['SECRET_TOKEN"] | |
YourAPP::Application.config.secret_key_base = if Rails.env.development? or Rails.env.test? | |
"3eb6db5a9026c547c72708438d496d942e976b252138db7e4e0ee5edd7539457d3ed0fa02ee5e7179420ce5290462018591adaf5f42adcf855da04877827def2" | |
else |
<%= link_to "NEW TAB", merchants_path, :target => '_blank' %> | |
<%= link_to "POPUP!", | |
merchants_path, | |
:onclick=>"window.open(this.href,'popup_form', 'height=371, width=460, top=200px, left=100px, directories=no, location=no, menubar=no, status=no, titlebar=no, toolbar=no, status=no');return false;" %> |