engineyard-migrate 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
5
+ tmp
6
+ fixtures/repos
7
+ fixtures/credentials
data/.rvmrc ADDED
@@ -0,0 +1,47 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # This is an RVM Project .rvmrc file, used to automatically load the ruby
4
+ # development environment upon cd'ing into the directory
5
+
6
+ # First we specify our desired <ruby>[@<gemset>], the @gemset name is optional.
7
+ environment_id="ruby-1.8.7-p330@engineyard-migrate"
8
+
9
+ #
10
+ # First we attempt to load the desired environment directly from the environment
11
+ # file, this is very fast and efficicent compared to running through the entire
12
+ # CLI and selector. If you want feedback on which environment was used then
13
+ # insert the word 'use' after --create as this triggers verbose mode.
14
+ #
15
+ if [[ -d "${rvm_path:-$HOME/.rvm}/environments" \
16
+ && -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]] ; then
17
+ \. "${rvm_path:-$HOME/.rvm}/environments/$environment_id"
18
+ else
19
+ # If the environment file has not yet been created, use the RVM CLI to select.
20
+ rvm --create use "$environment_id"
21
+ fi
22
+
23
+ #
24
+ # If you use an RVM gemset file to install a list of gems (*.gems), you can have
25
+ # it be automatically loaded, uncomment the following and adjust the filename if
26
+ # necessary.
27
+ #
28
+ # filename=".gems"
29
+ # if [[ -s "$filename" ]] ; then
30
+ # rvm gemset import "$filename" | grep -v already | grep -v listed | grep -v complete | sed '/^$/d'
31
+ # fi
32
+
33
+ #
34
+ # If you use bundler and would like to run bundle each time you enter the
35
+ # directory you can uncomment the following code.
36
+ #
37
+ # # Ensure that Bundler is installed, install it if it is not.
38
+ # if ! command -v bundle ; then
39
+ # printf "The rubygem 'bundler' is not installed, installing it now.\n"
40
+ # gem install bundler
41
+ # fi
42
+ #
43
+ # # Bundle while redcing excess noise.
44
+ # printf "Bundling your gems this may take a few minutes on a fresh clone.\n"
45
+ # bundle | grep -v 'Using' | grep -v 'complete' | sed '/^$/d'
46
+ #
47
+
@@ -0,0 +1,10 @@
1
+ # Change Log
2
+
3
+ A log of changes. But prettier.
4
+
5
+ ## 1.0.0 2011-03-11
6
+
7
+ Initial release!
8
+
9
+ * Migrate database from Heroku application to a running AppCloud application
10
+ * Expansive integration test suite
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in engineyard-migrate.gemspec
4
+ gemspec
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2011 Engine Yard
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOa AND
17
+ NONINFRINGEMENT. IN NO EVENT SaALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,61 @@
1
+ # Migrate your Rails application to Engine Yard AppCloud
2
+
3
+ Want to migrate your Ruby on Rails application from Heroku (or similar) up to Engine Yard AppCloud? This is the tool for you.
4
+
5
+ Currently supported: **Migrate Heroku to AppCloud**.
6
+
7
+ <img src="https://img.skitch.com/20110311-bbtk63ht5272jt2q2wsm3kh22c.png">
8
+
9
+ ## Installation
10
+
11
+ Currently, it is only installable from source.
12
+
13
+ bundle
14
+ rake install
15
+
16
+ ## Usage
17
+
18
+ The tool is simple to use. If you need to do something, it will tell you.
19
+
20
+ ey-migrate heroku path/to/heroku/app
21
+
22
+ ## Migration from Salesforce Heroku
23
+
24
+ The migration tool assumes you have:
25
+
26
+ * A running Heroku application with your data in its SQL database
27
+ * A Gemfile, rather than Heroku's deprecated .gems format
28
+ * Added `mysql2` to your Gemfile
29
+ * This upgraded application running on AppCloud without any of your data
30
+
31
+ ### Database
32
+
33
+ Your SQL database is automatically migrated to your AppCloud application via `ey-migrate heroku`.
34
+
35
+ A MySQL database is created automatically for you for each AppCloud application. On a 1 instance environment it runs on the same instances as your web application. For dedicated databases, use a 2+ instance environment with a dedicated database instance.
36
+
37
+ ### Workers
38
+
39
+ Automated support for setting up delayed_job workers is coming.
40
+
41
+ ### Other add-ons
42
+
43
+ If you have specific Heroku Add-Ons you'd like to be automatically migrated to AppCloud, please leave a [note/request](https://github.com/engineyard/engineyard-migrate).
44
+
45
+ ## Development of project
46
+
47
+ ### Running tests
48
+
49
+ Then to run tests:
50
+
51
+ bundle
52
+ rake
53
+
54
+ This will install `.ssh/config` required for your SSH credentials to run the test suite.
55
+
56
+ ### Credentials
57
+
58
+ To run the integration tests, you either need access to the [credentials repository](https://github.com/engineyard/ey-migrate-test-credentials)
59
+
60
+ Please send a Github message to `drnic` requesting access to the credentials. You'll then be able to run the test suite.
61
+
@@ -0,0 +1,54 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
3
+
4
+ require 'rspec/core/rake_task'
5
+
6
+ desc "Run all examples"
7
+ RSpec::Core::RakeTask.new
8
+
9
+ namespace :cucumber do
10
+ require 'cucumber/rake/task'
11
+ Cucumber::Rake::Task.new(:wip, 'Run features that are being worked on') do |t|
12
+ t.cucumber_opts = "--tags @wip"
13
+ end
14
+ Cucumber::Rake::Task.new(:ok, 'Run features that should be working') do |t|
15
+ t.cucumber_opts = "--tags ~@wip"
16
+ end
17
+ task :all => [:ok, :wip]
18
+
19
+ desc "Download credentials"
20
+ task :download_credentials do
21
+ credentials = File.expand_path('../fixtures/credentials', __FILE__)
22
+ unless File.exists?(credentials)
23
+ sh "git clone git@github.com:engineyard/ey-migrate-test-credentials.git #{credentials}"
24
+ end
25
+ end
26
+
27
+ desc "Setup IdentityFile for SSH keys for running tests"
28
+ task :ssh_config do
29
+ puts "Installing SSH credentials for running integration tests..."
30
+ config_file = File.expand_path("~#{ENV['USER']}/.ssh/config")
31
+ identity_file = File.expand_path("../tmp/home/.ssh/id_rsa", __FILE__)
32
+ if File.exist? config_file
33
+ sh "ssh-config set ec2-50-17-248-148.compute-1.amazonaws.com IdentityFile #{identity_file}"
34
+ else
35
+ File.open(config_file, 'w')
36
+ sh "ssh-config set ec2-50-17-248-148.compute-1.amazonaws.com IdentityFile #{identity_file}"
37
+ File.delete(config_file + '~')
38
+ end
39
+ end
40
+ end
41
+
42
+ desc 'Alias for cucumber:ok'
43
+ task :cucumber => ['cucumber:download_credentials', 'cucumber:ssh_config', 'cucumber:ok']
44
+
45
+ desc "Start test server; Run cucumber:ok; Kill Test Server;"
46
+ task :default => ["spec", "cucumber"]
47
+
48
+ desc "Clean out cached git app repos"
49
+ task :clean_app_repos do
50
+ repos_path = File.dirname(__FILE__) + "/fixtures/repos"
51
+ FileUtils.rm_rf(repos_path)
52
+ puts "Removed #{repos_path}..."
53
+ end
54
+
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rubygems'
4
+ $:.unshift(File.expand_path(File.dirname(__FILE__) + "/../lib"))
5
+ require 'engineyard-migrate'
6
+ require 'engineyard-migrate/cli'
7
+
8
+ $stdout.sync = true
9
+
10
+ Engineyard::Migrate::CLI.start
@@ -0,0 +1,351 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>ActiveLayerIndex</key>
6
+ <integer>0</integer>
7
+ <key>ApplicationVersion</key>
8
+ <array>
9
+ <string>com.omnigroup.OmniGrafflePro</string>
10
+ <string>138.17.0.133677</string>
11
+ </array>
12
+ <key>AutoAdjust</key>
13
+ <true/>
14
+ <key>BackgroundGraphic</key>
15
+ <dict>
16
+ <key>Bounds</key>
17
+ <string>{{0, 0}, {576, 733}}</string>
18
+ <key>Class</key>
19
+ <string>SolidGraphic</string>
20
+ <key>ID</key>
21
+ <integer>2</integer>
22
+ <key>Style</key>
23
+ <dict>
24
+ <key>shadow</key>
25
+ <dict>
26
+ <key>Draws</key>
27
+ <string>NO</string>
28
+ </dict>
29
+ <key>stroke</key>
30
+ <dict>
31
+ <key>Draws</key>
32
+ <string>NO</string>
33
+ </dict>
34
+ </dict>
35
+ </dict>
36
+ <key>CanvasOrigin</key>
37
+ <string>{0, 0}</string>
38
+ <key>ColumnAlign</key>
39
+ <integer>1</integer>
40
+ <key>ColumnSpacing</key>
41
+ <real>36</real>
42
+ <key>CreationDate</key>
43
+ <string>2011-03-11 13:52:41 -0800</string>
44
+ <key>Creator</key>
45
+ <string>Dr Nic Williams</string>
46
+ <key>DisplayScale</key>
47
+ <string>1 0/72 in = 1 0/72 in</string>
48
+ <key>GraphDocumentVersion</key>
49
+ <integer>6</integer>
50
+ <key>GraphicsList</key>
51
+ <array>
52
+ <dict>
53
+ <key>Bounds</key>
54
+ <string>{{221.5, 62.5}, {74, 40}}</string>
55
+ <key>Class</key>
56
+ <string>ShapedGraphic</string>
57
+ <key>ID</key>
58
+ <integer>29</integer>
59
+ <key>Rotation</key>
60
+ <real>5.9071908253827132e-06</real>
61
+ <key>Shape</key>
62
+ <string>AdjustableArrow</string>
63
+ <key>ShapeData</key>
64
+ <dict>
65
+ <key>ratio</key>
66
+ <real>0.50000017881393433</real>
67
+ <key>width</key>
68
+ <real>20.000001907348633</real>
69
+ </dict>
70
+ <key>Style</key>
71
+ <dict>
72
+ <key>fill</key>
73
+ <dict>
74
+ <key>Color</key>
75
+ <dict>
76
+ <key>b</key>
77
+ <string>0.696626</string>
78
+ <key>g</key>
79
+ <string>0.354368</string>
80
+ <key>r</key>
81
+ <string>0.112333</string>
82
+ </dict>
83
+ <key>FillType</key>
84
+ <integer>2</integer>
85
+ <key>GradientAngle</key>
86
+ <real>355</real>
87
+ <key>GradientColor</key>
88
+ <dict>
89
+ <key>b</key>
90
+ <string>0.829482</string>
91
+ <key>g</key>
92
+ <string>0.541172</string>
93
+ <key>r</key>
94
+ <string>0.272927</string>
95
+ </dict>
96
+ <key>MiddleFraction</key>
97
+ <real>0.4523809552192688</real>
98
+ </dict>
99
+ <key>shadow</key>
100
+ <dict>
101
+ <key>Color</key>
102
+ <dict>
103
+ <key>a</key>
104
+ <string>0.4</string>
105
+ <key>b</key>
106
+ <string>0</string>
107
+ <key>g</key>
108
+ <string>0</string>
109
+ <key>r</key>
110
+ <string>0</string>
111
+ </dict>
112
+ <key>ShadowVector</key>
113
+ <string>{0, 2}</string>
114
+ </dict>
115
+ <key>stroke</key>
116
+ <dict>
117
+ <key>Color</key>
118
+ <dict>
119
+ <key>b</key>
120
+ <string>0.794995</string>
121
+ <key>g</key>
122
+ <string>0.459724</string>
123
+ <key>r</key>
124
+ <string>0</string>
125
+ </dict>
126
+ </dict>
127
+ </dict>
128
+ <key>TextRelativeArea</key>
129
+ <string>{{0.125, 0.25}, {0.75, 0.5}}</string>
130
+ <key>isConnectedShape</key>
131
+ <true/>
132
+ </dict>
133
+ <dict>
134
+ <key>Bounds</key>
135
+ <string>{{311, 29}, {83, 107}}</string>
136
+ <key>Class</key>
137
+ <string>ShapedGraphic</string>
138
+ <key>ID</key>
139
+ <integer>6</integer>
140
+ <key>ImageID</key>
141
+ <integer>2</integer>
142
+ <key>Shape</key>
143
+ <string>Rectangle</string>
144
+ <key>Style</key>
145
+ <dict>
146
+ <key>fill</key>
147
+ <dict>
148
+ <key>Draws</key>
149
+ <string>NO</string>
150
+ </dict>
151
+ <key>shadow</key>
152
+ <dict>
153
+ <key>Draws</key>
154
+ <string>NO</string>
155
+ </dict>
156
+ <key>stroke</key>
157
+ <dict>
158
+ <key>Draws</key>
159
+ <string>NO</string>
160
+ </dict>
161
+ </dict>
162
+ </dict>
163
+ <dict>
164
+ <key>Bounds</key>
165
+ <string>{{41, 55}, {165, 55}}</string>
166
+ <key>Class</key>
167
+ <string>ShapedGraphic</string>
168
+ <key>ID</key>
169
+ <integer>4</integer>
170
+ <key>ImageID</key>
171
+ <integer>1</integer>
172
+ <key>Shape</key>
173
+ <string>Rectangle</string>
174
+ <key>Style</key>
175
+ <dict>
176
+ <key>fill</key>
177
+ <dict>
178
+ <key>Draws</key>
179
+ <string>NO</string>
180
+ </dict>
181
+ <key>shadow</key>
182
+ <dict>
183
+ <key>Draws</key>
184
+ <string>NO</string>
185
+ </dict>
186
+ <key>stroke</key>
187
+ <dict>
188
+ <key>Draws</key>
189
+ <string>NO</string>
190
+ </dict>
191
+ </dict>
192
+ </dict>
193
+ </array>
194
+ <key>GridInfo</key>
195
+ <dict/>
196
+ <key>GuidesLocked</key>
197
+ <string>NO</string>
198
+ <key>GuidesVisible</key>
199
+ <string>YES</string>
200
+ <key>HPages</key>
201
+ <integer>1</integer>
202
+ <key>ImageCounter</key>
203
+ <integer>3</integer>
204
+ <key>ImageLinkBack</key>
205
+ <array>
206
+ <dict/>
207
+ <dict/>
208
+ </array>
209
+ <key>ImageList</key>
210
+ <array>
211
+ <string>image2.tiff</string>
212
+ <string>image1.tiff</string>
213
+ </array>
214
+ <key>KeepToScale</key>
215
+ <false/>
216
+ <key>Layers</key>
217
+ <array>
218
+ <dict>
219
+ <key>Lock</key>
220
+ <string>NO</string>
221
+ <key>Name</key>
222
+ <string>Layer 1</string>
223
+ <key>Print</key>
224
+ <string>YES</string>
225
+ <key>View</key>
226
+ <string>YES</string>
227
+ </dict>
228
+ </array>
229
+ <key>LayoutInfo</key>
230
+ <dict>
231
+ <key>Animate</key>
232
+ <string>NO</string>
233
+ <key>circoMinDist</key>
234
+ <real>18</real>
235
+ <key>circoSeparation</key>
236
+ <real>0.0</real>
237
+ <key>layoutEngine</key>
238
+ <string>dot</string>
239
+ <key>neatoSeparation</key>
240
+ <real>0.0</real>
241
+ <key>twopiSeparation</key>
242
+ <real>0.0</real>
243
+ </dict>
244
+ <key>LinksVisible</key>
245
+ <string>NO</string>
246
+ <key>MagnetsVisible</key>
247
+ <string>NO</string>
248
+ <key>MasterSheets</key>
249
+ <array/>
250
+ <key>ModificationDate</key>
251
+ <string>2011-03-11 13:57:10 -0800</string>
252
+ <key>Modifier</key>
253
+ <string>Dr Nic Williams</string>
254
+ <key>NotesVisible</key>
255
+ <string>NO</string>
256
+ <key>Orientation</key>
257
+ <integer>2</integer>
258
+ <key>OriginVisible</key>
259
+ <string>NO</string>
260
+ <key>PageBreaks</key>
261
+ <string>YES</string>
262
+ <key>PrintInfo</key>
263
+ <dict>
264
+ <key>NSBottomMargin</key>
265
+ <array>
266
+ <string>float</string>
267
+ <string>41</string>
268
+ </array>
269
+ <key>NSLeftMargin</key>
270
+ <array>
271
+ <string>float</string>
272
+ <string>18</string>
273
+ </array>
274
+ <key>NSPaperSize</key>
275
+ <array>
276
+ <string>size</string>
277
+ <string>{612, 792}</string>
278
+ </array>
279
+ <key>NSRightMargin</key>
280
+ <array>
281
+ <string>float</string>
282
+ <string>18</string>
283
+ </array>
284
+ <key>NSTopMargin</key>
285
+ <array>
286
+ <string>float</string>
287
+ <string>18</string>
288
+ </array>
289
+ </dict>
290
+ <key>PrintOnePage</key>
291
+ <false/>
292
+ <key>ReadOnly</key>
293
+ <string>NO</string>
294
+ <key>RowAlign</key>
295
+ <integer>1</integer>
296
+ <key>RowSpacing</key>
297
+ <real>36</real>
298
+ <key>SheetTitle</key>
299
+ <string>Canvas 1</string>
300
+ <key>SmartAlignmentGuidesActive</key>
301
+ <string>YES</string>
302
+ <key>SmartDistanceGuidesActive</key>
303
+ <string>YES</string>
304
+ <key>UniqueID</key>
305
+ <integer>1</integer>
306
+ <key>UseEntirePage</key>
307
+ <false/>
308
+ <key>VPages</key>
309
+ <integer>1</integer>
310
+ <key>WindowInfo</key>
311
+ <dict>
312
+ <key>CurrentSheet</key>
313
+ <integer>0</integer>
314
+ <key>ExpandedCanvases</key>
315
+ <array>
316
+ <dict>
317
+ <key>name</key>
318
+ <string>Canvas 1</string>
319
+ </dict>
320
+ </array>
321
+ <key>Frame</key>
322
+ <string>{{43, 185}, {916, 591}}</string>
323
+ <key>ListView</key>
324
+ <true/>
325
+ <key>OutlineWidth</key>
326
+ <integer>142</integer>
327
+ <key>RightSidebar</key>
328
+ <false/>
329
+ <key>ShowRuler</key>
330
+ <true/>
331
+ <key>Sidebar</key>
332
+ <true/>
333
+ <key>SidebarWidth</key>
334
+ <integer>120</integer>
335
+ <key>VisibleRegion</key>
336
+ <string>{{-95, 0}, {767, 437}}</string>
337
+ <key>Zoom</key>
338
+ <real>1</real>
339
+ <key>ZoomValues</key>
340
+ <array>
341
+ <array>
342
+ <string>Canvas 1</string>
343
+ <real>1</real>
344
+ <real>1</real>
345
+ </array>
346
+ </array>
347
+ </dict>
348
+ <key>saveQuickLookFiles</key>
349
+ <string>YES</string>
350
+ </dict>
351
+ </plist>