shoestrap 0.2.5 → 0.3.0.pre

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,11 @@
1
1
  #Changelog
2
2
 
3
+ ## 0.3.0.pre - 2013-04-25
4
+
5
+ * create db before migrating (doh!)
6
+ * rakefiles for deployment stay in kushsaft and can be required in the application
7
+ * add middleman deployment task
8
+
3
9
  ## 0.2.5 - 2013-03-23
4
10
 
5
11
  - update airbrake config for api token
@@ -5,6 +5,8 @@ module Shoestrap
5
5
  class DeploymentGenerator < Rails::Generators::Base
6
6
  source_root File.expand_path('../templates/deployment', __FILE__)
7
7
 
8
+ # TODO: enable js runtime in Gemfile
9
+
8
10
  def add_unicorn_config
9
11
  copy_file 'unicorn.rb', 'config/unicorn.rb'
10
12
  end
@@ -14,14 +16,19 @@ module Shoestrap
14
16
  end
15
17
 
16
18
  def add_deployment_task
17
- template 'deployment.rake.erb', 'lib/tasks/deployment.rake'
19
+ inject_into_file 'Rakefile', "\nrequire 'shoestrap/tasks/rails'\n", :after => 'Application.load_tasks'
20
+ remove_file 'lib/tasks/deployment.rake'
18
21
  end
19
22
 
20
23
  def add_airbrake_config
21
24
  copy_file 'airbrake.rb', 'config/initializers/airbrake.rb'
22
25
  end
23
26
 
24
- protected
27
+ def add_app_name
28
+ inject_into_file 'config/application.rb', "\n Rails.configuration.app_name = '#{app_name}'\n", :after => 'class Application < Rails::Application'
29
+ end
30
+
31
+ private
25
32
 
26
33
  def app_name
27
34
  @app_name ||= ask("What is this app's name?")
@@ -21,6 +21,7 @@ module Shoestrap
21
21
  end
22
22
 
23
23
  def setup_database
24
+ rake 'db:create'
24
25
  rake 'db:migrate'
25
26
  rake 'db:seed'
26
27
  end
@@ -0,0 +1,17 @@
1
+ #
2
+ # Common Rake Tasks for Middleman Apps
3
+ #
4
+
5
+ require 'airbrake/tasks'
6
+
7
+ desc 'Build the project'
8
+ task :build do
9
+ puts 'RUNNING MIDDLEMAN BUILD'
10
+ `rm public && bundle exec middleman build && ln -s build public`
11
+ end
12
+
13
+ desc 'Post Deployment Task for blazing'
14
+ task :post_deploy => :build do
15
+ system "rake airbrake:deploy TO=#{ENV['RAILS_ENV']} REVISION=$(git rev-parse HEAD)"
16
+ end
17
+
@@ -0,0 +1,46 @@
1
+ #
2
+ # Common Rake Tasks for Middleman Apps
3
+ #
4
+
5
+ require 'airbrake/tasks'
6
+
7
+ desc 'Post Deployment Task for blazing'
8
+ task :post_deploy => :environment do
9
+ #
10
+ # Precompile assets
11
+ #
12
+ puts 'Precompiling assets'
13
+ Rake::Task["assets:precompile"].invoke
14
+
15
+ #
16
+ # Run migrations
17
+ #
18
+ puts 'Running migrations if necessary'
19
+ Rake::Task["db:migrate"].invoke
20
+
21
+ #
22
+ # Trigger Unicorn reexec with 0 downtime
23
+ #
24
+ puts 'restarting unicorns'
25
+ # TODO: inject Rails.configuration.app_name into application.rb, document in changelog! (this should be done in the deployment generator!)
26
+ system "#{ENV['HOME']}/unicorn.sh upgrade #{Rails.configuration.app_name}_#{Rails.env}"
27
+
28
+ #
29
+ # Enable monit monitoring
30
+ #
31
+ puts 'enable monit'
32
+ system "monit -g #{Rails.configuration.app_name}_#{Rails.env} monitor"
33
+
34
+ #
35
+ # Notify Airbrake of deployment
36
+ #
37
+ puts 'notifying airbrake'
38
+ system "rake airbrake:deploy TO=#{Rails.env} REVISION=$(git rev-parse HEAD)"
39
+ end
40
+
41
+ # TODO: db:pull, db:push, assets:pull, assets:push data:pull, data:push
42
+ # - generate task for each env available in environments
43
+ # - go to server, do yml dump, scp file down, db load
44
+ # - needs generic "go to server" method? => useful for other things!
45
+ # TODO: setup (https://github.com/screenconcept/shoestrap/issues/6)
46
+
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "shoestrap"
6
- s.version = '0.2.5'
6
+ s.version = '0.3.0.pre'
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ["Immanuel Häussermann", "Felipe Kaufmann", "Phil Schilter", "Noëlle Rosenberg"]
9
9
  s.email = "info@screenconcept.ch"
@@ -21,4 +21,5 @@ Gem::Specification.new do |s|
21
21
  s.add_development_dependency 'rspec'
22
22
  s.add_development_dependency 'pry'
23
23
  s.add_dependency 'rails'
24
+ s.add_dependency 'airbrake'
24
25
  end
@@ -21,16 +21,17 @@ gem 'fabrication'
21
21
  gem 'shoestrap'
22
22
  gem 'kuhsaft'
23
23
  gem 'pg'
24
+ gem 'airbrake'
24
25
 
25
26
  group :development, :test do
26
27
  gem 'pry'
27
28
  gem 'rspec-rails'
28
- gem 'cucumber-rails'
29
29
  end
30
30
 
31
31
  group :test do
32
32
  gem 'database_cleaner'
33
33
  gem 'sqlite3'
34
+ gem 'cucumber-rails', :require => false
34
35
  end
35
36
 
36
37
  group :development do
metadata CHANGED
@@ -1,8 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shoestrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
5
- prerelease:
4
+ version: 0.3.0.pre
5
+ prerelease: 6
6
6
  platform: ruby
7
7
  authors:
8
8
  - Immanuel Häussermann
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2013-04-23 00:00:00.000000000 Z
15
+ date: 2013-04-25 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: rspec
@@ -62,6 +62,22 @@ dependencies:
62
62
  - - ! '>='
63
63
  - !ruby/object:Gem::Version
64
64
  version: '0'
65
+ - !ruby/object:Gem::Dependency
66
+ name: airbrake
67
+ requirement: !ruby/object:Gem::Requirement
68
+ none: false
69
+ requirements:
70
+ - - ! '>='
71
+ - !ruby/object:Gem::Version
72
+ version: '0'
73
+ type: :runtime
74
+ prerelease: false
75
+ version_requirements: !ruby/object:Gem::Requirement
76
+ none: false
77
+ requirements:
78
+ - - ! '>='
79
+ - !ruby/object:Gem::Version
80
+ version: '0'
65
81
  description: shoestrap is a rails app bootstrapper
66
82
  email: info@screenconcept.ch
67
83
  executables:
@@ -92,6 +108,8 @@ files:
92
108
  - lib/generators/shoestrap/templates/deployment/unicorn.rb
93
109
  - lib/shoestrap.rb
94
110
  - lib/shoestrap/app_builder.rb
111
+ - lib/shoestrap/tasks/middleman.rb
112
+ - lib/shoestrap/tasks/rails.rb
95
113
  - shoestrap.gemspec
96
114
  - templates/Gemfile.erb
97
115
  - templates/Guardfile
@@ -126,9 +144,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
126
144
  required_rubygems_version: !ruby/object:Gem::Requirement
127
145
  none: false
128
146
  requirements:
129
- - - ! '>='
147
+ - - ! '>'
130
148
  - !ruby/object:Gem::Version
131
- version: '0'
149
+ version: 1.3.1
132
150
  requirements: []
133
151
  rubyforge_project: shoestrap
134
152
  rubygems_version: 1.8.24