-
Notifications
You must be signed in to change notification settings - Fork 0
/
atom.xml
115 lines (96 loc) · 5.29 KB
/
atom.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title><![CDATA[Category: Rails | machty's thoughtz]]></title>
<link href="http://machty.github.com/blog/categories/rails/atom.xml" rel="self"/>
<link href="http://machty.github.com/"/>
<updated>2015-08-26T16:10:13-04:00</updated>
<id>http://machty.github.com/</id>
<author>
<name><![CDATA[Alex Matchneer]]></name>
</author>
<generator uri="http://octopress.org/">Octopress</generator>
<entry>
<title type="html"><![CDATA[Transferring S3-Enabled Heroku Apps Between Dev/Staging/Prod]]></title>
<link href="http://machty.github.com/blog/2012/11/05/transferring-s3-enabled-heroku-apps-between-dev-slash-staging-slash-prod/"/>
<updated>2012-11-05T00:01:00-05:00</updated>
<id>http://machty.github.com/blog/2012/11/05/transferring-s3-enabled-heroku-apps-between-dev-slash-staging-slash-prod</id>
<content type="html"><![CDATA[<p>You know, I could just write this in my Evernote and reference as
needed, but I'm writing it here, because I love you. But I'm in a hurry.</p>
<p>Here are the steps I take for transferring apps from my development
server to Heroku staging/production servers, which can get somewhat
complicated if Amazon S3 is involved.</p>
<!--more-->
<h3>Database</h3>
<p>You've already pushed your code to Heroku. That's the easy part. Now for the
database:</p>
<p><div class='bogus-wrapper'><notextile><figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>rvm use 1.9.2
</span><span class='line'>heroku db:push</span></code></pre></td></tr></table></div></figure></notextile></div></p>
<p><code>heroku db:push</code> uses <code>taps</code> to serialize and transmit all of your dev
database to the Heroku database. We rvm to Ruby 1.9.2 because Ruby 1.9.3
has mad issues serializing Datetimes. I think it was datetimes.
Something involving Psych. Anyway, just use 1.9.2.</p>
<h3>S3</h3>
<p>Let's assume you've started building the app/site using your own S3
bucket because you didn't want to wait for your client to get their
Amazon AWS account up and running. Now you need to take all the stuff
uploaded to your S3 bucket and move it to your client's bucket. This is
a scoatch tricky, but we shall prevail.</p>
<p>First, log into your client's AWS account and go to S3. Create the
bucket you'll be using, then open the bucket's properties, and click
<code>Add Bucket Policy</code>. Then paste in this, replacing the ALL CAPS
BUCKETNAME with the production bucket name you'll be using:</p>
<p><div class='bogus-wrapper'><notextile><figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
<span class='line-number'>11</span>
<span class='line-number'>12</span>
<span class='line-number'>13</span>
<span class='line-number'>14</span>
<span class='line-number'>15</span>
<span class='line-number'>16</span>
<span class='line-number'>17</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>{</p>
</span><span class='line'>
</span><span class='line'><pre><code> "Version": "2008-10-17",
</span><span class='line'> "Statement": [
</span><span class='line'> {
</span><span class='line'> "Sid": "AllowPublicRead",
</span><span class='line'> "Effect": "Allow",
</span><span class='line'> "Principal": {
</span><span class='line'> "AWS": "*"
</span><span class='line'> },
</span><span class='line'> "Action": "s3:GetObject",
</span><span class='line'> "Resource": "arn:aws:s3:::BUCKETNAME/*"
</span><span class='line'> }
</span><span class='line'> ]
</span><span class='line'></code></pre>
</span><span class='line'>
</span><span class='line'><p>}</span></code></pre></td></tr></table></div></figure></notextile></div></p>
<p>The purpose of this is to prepare for the next step, in which we'll be
pasting a bunch of files into this bucket, and we want them to go in
with public-read access rather than the default of, well, zero access
for anybody, ever, including the admin. If you think I'm going about
this wrong way, Disqus me them comments, but I don't think there's an
easier way.</p>
<p>Second, let's copy your dev buckets to disk. Download/open
<a href="http://www.3hubapp.com/">3hub</a>, and put in your
dev S3 account credentials, log in, select your dev bucket, and drag and
drop your root-level files to your desktop. Now take a 3 minute nap.</p>
<p>Wake up, grab a brush and put a little make up, then disconnect 3hub
from your dev account and log into your client's S3 account, and drag
those downloaded files from your desktop to your client's bucket. 5
minute nap. You've earned it. Now all your S3 files have been
transferred and have proper access permissions, thanks to your magic
bucket policy incantation.</p>
]]></content>
</entry>
</feed>