Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jqr/heroku_san
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v4.2.0
Choose a base ref
...
head repository: jqr/heroku_san
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.bundle
Gemfile.lock
doc
pkg
Thumbs.db
1 change: 1 addition & 0 deletions .ruby-gemset
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
heroku_san
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.2.4
13 changes: 10 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
language: ruby
script: "bundle exec rake travis"
rvm:
- 1.8.7
- 1.9.2
- 1.9.3
- 2.0.0-p648
- 2.1.8
- 2.2.4
- 2.3.0
before_install:
- git config --global user.email "heroku_san@example.com"
- git config --global user.name "Test User"
- wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh
- spec/support/heroku_login.sh
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Change Log (curated)

# The Future

* [https://github.com/fastestforward/heroku_san/releases](https://github.com/fastestforward/heroku_san/releases)
* GitHub releases pages will replace the ChangeLog

## v4.3.0

* Add #ensure_{all|one}_worker(s)_running -- which will restart your web workers until they stay up
* Closes #137

## v4.2.0

* Wrap API calls so that errors are reported in a more human-fiendly way
19 changes: 17 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
source :rubygems
source 'https://rubygems.org'

# Specify dependencies in heroku_san.gemspec
gemspec
gemspec

group :test do
gem 'aruba', '~> 0.14.0'
gem 'bundler'
gem 'cucumber'
gem 'godot'
gem 'rails'
gem 'rake'
gem 'rspec'
end

group :development do
gem 'git-smart'
gem 'travis', '~> 1.5.6'
end
218 changes: 218 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,218 @@
PATH
remote: .
specs:
heroku_san (4.4.0)
bundler
heroku-api (>= 0.1.2)
json
rake

GEM
remote: https://rubygems.org/
specs:
actionmailer (4.2.6)
actionpack (= 4.2.6)
actionview (= 4.2.6)
activejob (= 4.2.6)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 1.0, >= 1.0.5)
actionpack (4.2.6)
actionview (= 4.2.6)
activesupport (= 4.2.6)
rack (~> 1.6)
rack-test (~> 0.6.2)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (4.2.6)
activesupport (= 4.2.6)
builder (~> 3.1)
erubis (~> 2.7.0)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
activejob (4.2.6)
activesupport (= 4.2.6)
globalid (>= 0.3.0)
activemodel (4.2.6)
activesupport (= 4.2.6)
builder (~> 3.1)
activerecord (4.2.6)
activemodel (= 4.2.6)
activesupport (= 4.2.6)
arel (~> 6.0)
activesupport (4.2.6)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.3.5)
arel (6.0.3)
aruba (0.14.0)
childprocess (~> 0.5.6)
contracts (~> 0.9)
cucumber (>= 1.3.19)
ffi (~> 1.9.10)
rspec-expectations (>= 2.99)
thor (~> 0.19)
backports (3.3.5)
builder (3.2.2)
childprocess (0.5.9)
ffi (~> 1.0, >= 1.0.11)
coderay (1.0.9)
colorize (0.5.8)
concurrent-ruby (1.0.1)
contracts (0.13.0)
cucumber (2.3.2)
builder (>= 2.1.2)
cucumber-core (~> 1.4.0)
cucumber-wire (~> 0.0.1)
diff-lcs (>= 1.1.3)
gherkin (~> 3.2.0)
multi_json (>= 1.7.5, < 2.0)
multi_test (>= 0.1.2)
cucumber-core (1.4.0)
gherkin (~> 3.2.0)
cucumber-wire (0.0.1)
diff-lcs (1.2.5)
erubis (2.7.0)
ethon (0.6.1)
ffi (>= 1.3.0)
mime-types (~> 1.18)
excon (0.48.0)
faraday (0.8.8)
multipart-post (~> 1.2.0)
faraday_middleware (0.9.0)
faraday (>= 0.7.4, < 0.9)
ffi (1.9.10)
gh (0.13.0)
addressable
backports
faraday (~> 0.8)
multi_json (~> 1.0)
net-http-persistent (>= 2.7)
net-http-pipeline
gherkin (3.2.0)
git-smart (0.1.9)
colorize
globalid (0.3.6)
activesupport (>= 4.1.0)
godot (0.3.0)
heroku-api (0.4.2)
excon (~> 0.45)
multi_json (~> 1.8)
highline (1.6.20)
i18n (0.7.0)
json (1.8.3)
launchy (2.3.0)
addressable (~> 2.3)
loofah (2.0.3)
nokogiri (>= 1.5.9)
mail (2.6.3)
mime-types (>= 1.16, < 3)
method_source (0.8.2)
mime-types (1.25.1)
mini_portile2 (2.0.0)
minitest (5.8.4)
multi_json (1.11.2)
multi_test (0.1.2)
multipart-post (1.2.0)
net-http-persistent (2.9)
net-http-pipeline (1.0.1)
netrc (0.7.7)
nokogiri (1.6.7.2)
mini_portile2 (~> 2.0.0.rc2)
pry (0.9.12.2)
coderay (~> 1.0.5)
method_source (~> 0.8)
slop (~> 3.4)
pusher-client (0.3.1)
ruby-hmac (~> 0.4.0)
websocket (~> 1.0.0)
rack (1.6.4)
rack-test (0.6.3)
rack (>= 1.0)
rails (4.2.6)
actionmailer (= 4.2.6)
actionpack (= 4.2.6)
actionview (= 4.2.6)
activejob (= 4.2.6)
activemodel (= 4.2.6)
activerecord (= 4.2.6)
activesupport (= 4.2.6)
bundler (>= 1.3.0, < 2.0)
railties (= 4.2.6)
sprockets-rails
rails-deprecated_sanitizer (1.0.3)
activesupport (>= 4.2.0.alpha)
rails-dom-testing (1.0.7)
activesupport (>= 4.2.0.beta, < 5.0)
nokogiri (~> 1.6.0)
rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.3)
loofah (~> 2.0)
railties (4.2.6)
actionpack (= 4.2.6)
activesupport (= 4.2.6)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (11.1.0)
rspec (3.4.0)
rspec-core (~> 3.4.0)
rspec-expectations (~> 3.4.0)
rspec-mocks (~> 3.4.0)
rspec-core (3.4.4)
rspec-support (~> 3.4.0)
rspec-expectations (3.4.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.4.0)
rspec-mocks (3.4.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.4.0)
rspec-support (3.4.1)
ruby-hmac (0.4.0)
slop (3.4.6)
sprockets (3.5.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.0.4)
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
terminal-notifier (1.5.1)
thor (0.19.1)
thread_safe (0.3.5)
travis (1.5.6)
backports
faraday (~> 0.8.7)
faraday_middleware (~> 0.9)
gh (~> 0.13)
highline (~> 1.6)
launchy (~> 2.1)
netrc (~> 0.7)
pry (~> 0.9)
pusher-client (~> 0.3, >= 0.3.1)
terminal-notifier (>= 1.4.2)
typhoeus (~> 0.6)
typhoeus (0.6.5)
ethon (~> 0.6.1)
tzinfo (1.2.2)
thread_safe (~> 0.1)
websocket (1.0.7)

PLATFORMS
ruby

DEPENDENCIES
aruba (~> 0.14.0)
bundler
cucumber
git-smart
godot
heroku_san!
rails
rake
rspec
travis (~> 1.5.6)

BUNDLED WITH
1.11.2
21 changes: 21 additions & 0 deletions Guardfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# A sample Guardfile
# More info at https://github.com/guard/guard#readme

guard 'bundler' do
watch('Gemfile')
watch(/^.+\.gemspec/)
end

guard 'rspec' do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { "spec" }
watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
watch(%r{^spec/fixtures/(.+)\.yml$}) { "spec" }
end

guard 'cucumber', :cli => '--tags ~@slow_process --format progress' do
watch(%r{^features/.+\.feature$})
watch(%r{^features/support/.+$}) { 'features' }
watch(%r{^features/step_definitions/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'features' }
end
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Heroku San
Helpful rake tasks for Heroku.

[![Build Status](https://secure.travis-ci.org/fastestforward/heroku_san.png)](http://travis-ci.org/fastestforward/heroku_san)
[![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/fastestforward/heroku_san)
[![Build Status](https://secure.travis-ci.org/jqr/heroku_san.png)](http://travis-ci.org/jqr/heroku_san)
[![Code Climate](https://codeclimate.com/github/jqr/heroku_san.png)](https://codeclimate.com/github/jqr/heroku_san)
[![Gemnasium](https://gemnasium.com/jqr/heroku_san.png)](https://gemnasium.com/jqr/heroku_san)

## Install

### Rails 3
### Rails 3+

Add this to your `Gemfile`:

@@ -62,7 +63,7 @@ Update your `Rakefile`:

In `config/heroku.yml` you will need to add the Heroku apps that you would like to attach to this project. You can generate this file by running:

### Rails 3
### Rails 3+

```sh
rails generate heroku_san
17 changes: 17 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -3,6 +3,8 @@ require 'rubygems'
require 'bundler/setup'
require 'bundler/gem_tasks'
require 'rspec/core/rake_task'
require 'cucumber'
require 'cucumber/rake/task'

desc 'Default: run unit tests.'
task :default => :spec
@@ -11,3 +13,18 @@ desc "Run all specs"
RSpec::Core::RakeTask.new do |t|
t.pattern = 'spec/**/*_spec.rb'
end

namespace 'cucumber' do
Cucumber::Rake::Task.new(:remote) do |t|
t.profile = "remote"
end

Cucumber::Rake::Task.new(:default) do |t|
t.profile = "default"
end
end

desc "Run travis test suite"
task :travis => [:spec, 'cucumber:default', 'cucumber:remote']

# for app in `heroku apps | tail +2`; do heroku apps:destroy --app $app --confirm $app; done
8 changes: 4 additions & 4 deletions examples/auto_tagger.rake
Original file line number Diff line number Diff line change
@@ -18,9 +18,10 @@

STAGES = %w[ci staging production]

def create_and_push(stage)
def create_and_push(stage, revision = nil)
auto_tag = AutoTagger::Base.new(stages: STAGES, stage: stage, verbose: true, push_refs: false, refs_to_keep: 100)
tag = auto_tag.create_ref(auto_tag.last_ref_from_previous_stage.try(:sha))
sha = revision || auto_tag.last_ref_from_previous_stage.try(:sha)
tag = auto_tag.create_ref(sha)
sh "git push origin #{tag.name}"
auto_tag.delete_locally
auto_tag.delete_on_remote
@@ -32,7 +33,7 @@ end

task :after_deploy do
each_heroku_app do |stage|
create_and_push(stage.name)
create_and_push(stage.name, stage.revision)
end
Rake::Task['autotag:list'].invoke
end
@@ -58,5 +59,4 @@ namespace :autotag do
puts " ** %-12s %s" % [stage, log]
end
end
end
end
2 changes: 1 addition & 1 deletion features/config.feature
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Feature: Command Line

Background:
Given I run `rails new heroku_san_test --quiet --force --database=postgresql --skip-bundle --skip-javascript --skip-test-unit --skip-sprockets`
Given I run `rails new heroku_san_test --quiet --force --skip-active-record --skip-bundle --skip-javascript --skip-test-unit --skip-sprockets`
And I cd to "heroku_san_test"
And I overwrite "Gemfile" with:
"""
Loading