shoestrap 0.3.1.pre → 0.4.0

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.4.0 - 2013-05-28
4
+
5
+ * add tasks for syncing down db and assets from production
6
+ * fix translation file generation
7
+ * add experimental deployment task for old radiant apps
8
+
3
9
  ## 0.3.0 - 2013-05-01
4
10
 
5
11
  * set timezone to 'Bern' by default
@@ -6,6 +6,9 @@ module Shoestrap
6
6
  source_root File.expand_path('../templates/deployment', __FILE__)
7
7
 
8
8
  # TODO: enable js runtime in Gemfile
9
+ def add_required_gems
10
+ inject_into_file 'Gemfile', "\ngem 'yaml_db'", :after => "gem 'blazing'"
11
+ end
9
12
 
10
13
  def add_unicorn_config
11
14
  copy_file 'unicorn.rb', 'config/unicorn.rb'
@@ -3,6 +3,12 @@
3
3
  #
4
4
 
5
5
  require 'airbrake/tasks'
6
+ require 'blazing'
7
+
8
+ def ssh_path(environment)
9
+ blazing_config = Blazing::Config.parse
10
+ blazing_config.targets.find { |t| t.name == environment.to_sym }.location
11
+ end
6
12
 
7
13
  desc 'Post Deployment Task for blazing'
8
14
  task :post_deploy => :environment do
@@ -42,9 +48,34 @@ task :post_deploy => :environment do
42
48
  system "rake airbrake:deploy TO=#{Rails.env} REVISION=$(git rev-parse HEAD)"
43
49
  end
44
50
 
45
- # TODO: db:pull, db:push, assets:pull, assets:push data:pull, data:push
46
- # - generate task for each env available in environments
47
- # - go to server, do yml dump, scp file down, db load
48
- # - needs generic "go to server" method? => useful for other things!
51
+ namespace :sync do
52
+
53
+ desc 'Sync Assets and DB from TARGET_ENV into current RAILS_ENV'
54
+ task :all => [:db, :assets] do
55
+ end
56
+
57
+ desc 'Pull down DB from TARGET_ENV server into current RAILS_ENV'
58
+ task :db do
59
+ raise 'No TARGET_ENV specified!' unless ENV['TARGET_ENV']
60
+
61
+ puts "--> dumping #{ENV['TARGET_ENV']} db to yml file"
62
+ system "blazing goto #{ENV['TARGET_ENV']} -c 'bundle exec rake db:data:dump'"
63
+
64
+ puts '--> copying down yml file'
65
+ system "scp #{ssh_path(ENV['TARGET_ENV'])}/db/data.yml db/data.yml"
66
+
67
+ puts "--> loading yml data into #{Rails.env} DB"
68
+ system "bundle exec rake db:data:load"
69
+ end
70
+
71
+ desc 'Pull down uploaded assets from TARGET_ENV'
72
+ task :assets do
73
+ raise 'No TARGET_ENV specified!' unless ENV['TARGET_ENV']
74
+
75
+ puts '--> copying down assets'
76
+ system "scp -r #{ssh_path(ENV['TARGET_ENV'])}/public/uploads public/uploads"
77
+ end
78
+ end
79
+
49
80
  # TODO: setup (https://github.com/screenconcept/shoestrap/issues/6)
50
81
 
@@ -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.3.1.pre'
6
+ s.version = '0.4.0'
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"
@@ -22,4 +22,5 @@ Gem::Specification.new do |s|
22
22
  s.add_development_dependency 'pry'
23
23
  s.add_dependency 'rails'
24
24
  s.add_dependency 'airbrake'
25
+ s.add_dependency 'blazing', '0.4.0.beta3'
25
26
  end
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.3.1.pre
5
- prerelease: 6
4
+ version: 0.4.0
5
+ prerelease:
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-05-02 00:00:00.000000000 Z
15
+ date: 2013-05-28 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: rspec
@@ -78,6 +78,22 @@ dependencies:
78
78
  - - ! '>='
79
79
  - !ruby/object:Gem::Version
80
80
  version: '0'
81
+ - !ruby/object:Gem::Dependency
82
+ name: blazing
83
+ requirement: !ruby/object:Gem::Requirement
84
+ none: false
85
+ requirements:
86
+ - - '='
87
+ - !ruby/object:Gem::Version
88
+ version: 0.4.0.beta3
89
+ type: :runtime
90
+ prerelease: false
91
+ version_requirements: !ruby/object:Gem::Requirement
92
+ none: false
93
+ requirements:
94
+ - - '='
95
+ - !ruby/object:Gem::Version
96
+ version: 0.4.0.beta3
81
97
  description: shoestrap is a rails app bootstrapper
82
98
  email: info@screenconcept.ch
83
99
  executables:
@@ -142,15 +158,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
142
158
  - - ! '>='
143
159
  - !ruby/object:Gem::Version
144
160
  version: '0'
161
+ segments:
162
+ - 0
163
+ hash: 2530350505472567996
145
164
  required_rubygems_version: !ruby/object:Gem::Requirement
146
165
  none: false
147
166
  requirements:
148
- - - ! '>'
167
+ - - ! '>='
149
168
  - !ruby/object:Gem::Version
150
- version: 1.3.1
169
+ version: '0'
170
+ segments:
171
+ - 0
172
+ hash: 2530350505472567996
151
173
  requirements: []
152
174
  rubyforge_project: shoestrap
153
- rubygems_version: 1.8.24
175
+ rubygems_version: 1.8.25
154
176
  signing_key:
155
177
  specification_version: 3
156
178
  summary: A tool that helps you bootstrap your rails projects