ey-deploy 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ey-deploy/deploy.rb +7 -3
- data/lib/ey-deploy/version.rb +1 -1
- metadata +3 -4
- data/README.rdoc +0 -66
data/lib/ey-deploy/deploy.rb
CHANGED
@@ -99,7 +99,7 @@ module EY
|
|
99
99
|
|
100
100
|
def symlink_configs(release_to_link=c.latest_release)
|
101
101
|
puts "~> Symlinking configs"
|
102
|
-
|
102
|
+
[ "chmod -R g+w #{release_to_link}",
|
103
103
|
"rm -rf #{release_to_link}/log #{release_to_link}/public/system #{release_to_link}/tmp/pids",
|
104
104
|
"mkdir -p #{release_to_link}/tmp",
|
105
105
|
"ln -nfs #{c.shared_path}/log #{release_to_link}/log",
|
@@ -109,8 +109,12 @@ module EY
|
|
109
109
|
"ln -nfs #{c.shared_path}/pids #{release_to_link}/tmp/pids",
|
110
110
|
"ln -nfs #{c.shared_path}/config/database.yml #{release_to_link}/config/database.yml",
|
111
111
|
"ln -nfs #{c.shared_path}/config/mongrel_cluster.yml #{release_to_link}/config/mongrel_cluster.yml",
|
112
|
-
"chown -R #{c.user}:#{c.group} #{release_to_link}"
|
113
|
-
|
112
|
+
"chown -R #{c.user}:#{c.group} #{release_to_link}",
|
113
|
+
"if [ -f \"#{c.shared_path}/config/newrelic.yml\" ]; then ln -nfs #{c.shared_path}/config/newrelic.yml #{release_to_link}/config/newrelic.yml; fi",
|
114
|
+
|
115
|
+
].each do |cmd|
|
116
|
+
sudo cmd
|
117
|
+
end
|
114
118
|
end
|
115
119
|
|
116
120
|
# task
|
data/lib/ey-deploy/version.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 3
|
8
|
-
-
|
9
|
-
version: 0.3.
|
8
|
+
- 1
|
9
|
+
version: 0.3.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- EY Cloud Team
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-05-
|
17
|
+
date: 2010-05-18 00:00:00 -07:00
|
18
18
|
default_executable: eysd
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -111,7 +111,6 @@ files:
|
|
111
111
|
- lib/vendor/thor/thor.gemspec
|
112
112
|
- lib/vendor/thor/Thorfile
|
113
113
|
- LICENSE
|
114
|
-
- README.rdoc
|
115
114
|
has_rdoc: true
|
116
115
|
homepage: http://engineyard.com
|
117
116
|
licenses: []
|
data/README.rdoc
DELETED
@@ -1,66 +0,0 @@
|
|
1
|
-
== ey-deploy
|
2
|
-
|
3
|
-
We've been listening to your feedback here on the Engine Yard Cloud and we've heard that the current web deploy is not optimal. People like to see the deploy steps as they happen. not wait until the end to go through the logs to see what went wrong. It is also clear that running the full set of chef recipes every time you deploy is doing a lot of redundant work and taking a lot of time each deploy. So I say down and came up with a new deployment strategy that meets these needs and makes deploying to our cloud a much nicer experience. So today I am releasing a beta of our new git deployment strategy for you to use. This new system is 100% backwards and forwards compatible with the current web deploy. If you have a server already deployed you can start using this new system right on top of it with a few minutes of setup.
|
4
|
-
|
5
|
-
So here is the steps needed to get a new git push based deploy up and running on your cloud system. Let's assume that you have an environment called 'production' with an ip address of 123.123.123.123 and a unix user called 'deploy' with an application attached called 'railsapp'. In the instructions below please replace these items with the correct info for your own setup.
|
6
|
-
|
7
|
-
|
8
|
-
Once you have a server fully up and running, follow these steps:
|
9
|
-
|
10
|
-
1. SSH into each of the servers in your cluster, or just the single server if you have only one and run the following commands:
|
11
|
-
$ sudo gem install ey-deploy --source http://gems.engineyard.com
|
12
|
-
Successfully installed ey-deploy-0.0.7
|
13
|
-
1 gem installed
|
14
|
-
$ sudo ey-deploy-install
|
15
|
-
engineyard git hooks installed
|
16
|
-
|
17
|
-
Now back on your local machine,
|
18
|
-
|
19
|
-
cd railsapp
|
20
|
-
git remote add production deploy@123.123.123.123:/data/railsapp/shared/cached-copy
|
21
|
-
|
22
|
-
# NOTE make sure to replace 'deploy' with the username you created for this env
|
23
|
-
# NOTE also make sure to change the ip address to the address of your app master
|
24
|
-
# NOTE also make sure to replace 'railsapp' in the path with the name of your own application
|
25
|
-
|
26
|
-
If you have only one server then you can go ahead and deploy new code like this:
|
27
|
-
$ git commit -m "made some changes"
|
28
|
-
$ git push production master
|
29
|
-
|
30
|
-
If you have a cluster of servers you need to setup an ssh keypair named 'internal' for them to use to talk to each other.
|
31
|
-
|
32
|
-
$ cd ~/.ssh
|
33
|
-
$ ssh-keygen -t rsa
|
34
|
-
Generating public/private rsa key pair.
|
35
|
-
Enter file in which to save the key (/Users/ez/.ssh/id_rsa): internal
|
36
|
-
Enter passphrase (empty for no passphrase):
|
37
|
-
Enter same passphrase again:
|
38
|
-
Your identification has been saved in /Users/ez/.ssh/internal.
|
39
|
-
Your public key has been saved in /Users/ez/.ssh/foo.pub.
|
40
|
-
The key fingerprint is:
|
41
|
-
79:40:8a:18:84:ff:96:39:c7:3a:3d:f2:e9:20:a1:ea ez@ezra-zygmuntowiczs-macbook-pro.local
|
42
|
-
The key's randomart image is:
|
43
|
-
+--[ RSA 2048]----+
|
44
|
-
| oo . |
|
45
|
-
|. o . o |
|
46
|
-
| .. . . . |
|
47
|
-
| . o |
|
48
|
-
| .. + S . |
|
49
|
-
| . .* o . |
|
50
|
-
|. ...= |
|
51
|
-
|. .+.o. |
|
52
|
-
|oE =+. |
|
53
|
-
+-----------------+
|
54
|
-
|
55
|
-
Now you need to put the ssh keys in place on your servers. Run the following command once for each server in your cluster.
|
56
|
-
|
57
|
-
$ cd ~/.ssh
|
58
|
-
# do this for each server in your cluster
|
59
|
-
$ cat internal.pub | ssh deploy@server "cat >> ~/.ssh/authorized_keys && chmod 0600 ~/.ssh/authorized_keys"
|
60
|
-
$ cat internal | ssh deploy@server "cat > ~/.ssh/internal && chmod 0600 ~/.ssh/internal"
|
61
|
-
|
62
|
-
|
63
|
-
Once you have those keys in place you can start deploying to your cluster via git push. A few things to keep in mind with this new strategy. Your cluster does not run a git server, so you will still keep the canonical git repo on github or on your own git server somewhere. You can push any branch you want but you will always push to master on the far end as that is the branch that will get deployed on the server. But pushing another branch form your local repo to the remote master will work fine.
|
64
|
-
|
65
|
-
|
66
|
-
Thats it! you are now deploying with git directly to your instances. Please give this a try and give me some feedback! I'm hoping to hear from you if you use this new deploy strategy. You can reach me by responding to this post or email me at ez+git@engineyard.com.
|