heroku_deploy 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +17 -1
- data/VERSION +1 -1
- data/heroku_deploy.gemspec +2 -4
- data/lib/heroku_deploy/tasks.rb +53 -27
- metadata +4 -6
- data/.idea/dictionaries/rosshale.xml +0 -3
- data/config/heroku_deploy.yml +0 -6
data/README.markdown
CHANGED
@@ -1,4 +1,20 @@
|
|
1
1
|
# heroku_deploy
|
2
2
|
This gem is an easy way to quickly setup and
|
3
3
|
deploy staging and production environments for
|
4
|
-
your project on heroku.
|
4
|
+
your project on heroku.
|
5
|
+
|
6
|
+
###Installation Instructions
|
7
|
+
Install the gem:
|
8
|
+
sudo gem install heroku_deploy
|
9
|
+
|
10
|
+
In environment.rb
|
11
|
+
config.gem "heroku_deploy"
|
12
|
+
|
13
|
+
In your Rakefile:
|
14
|
+
begin
|
15
|
+
require 'heroku_deploy'
|
16
|
+
HerokuDeploy::Tasks.new( :staging_app => "example-app-staging", :production_app => "example-app")
|
17
|
+
rescue LoadError
|
18
|
+
puts "heroku_deploy (or a dependency) not available. Install it with: gem install heroku_deploy"
|
19
|
+
end
|
20
|
+
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.6
|
data/heroku_deploy.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{heroku_deploy}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.6"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Ross Hale", "Chris Lemcke"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-07-12}
|
13
13
|
s.description = %q{Deploy strategy and scripts for Heroku.}
|
14
14
|
s.email = %q{rosshale@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -17,11 +17,9 @@ Gem::Specification.new do |s|
|
|
17
17
|
]
|
18
18
|
s.files = [
|
19
19
|
".gitignore",
|
20
|
-
".idea/dictionaries/rosshale.xml",
|
21
20
|
"README.markdown",
|
22
21
|
"Rakefile",
|
23
22
|
"VERSION",
|
24
|
-
"config/heroku_deploy.yml",
|
25
23
|
"heroku_deploy.gemspec",
|
26
24
|
"lib/heroku_deploy.rb",
|
27
25
|
"lib/heroku_deploy/tasks.rb",
|
data/lib/heroku_deploy/tasks.rb
CHANGED
@@ -9,15 +9,17 @@ class Rake::Application
|
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
|
-
|
13
12
|
class HerokuDeploy
|
14
13
|
|
15
14
|
class Tasks < ::Rake::TaskLib
|
16
|
-
attr_accessor :heroku_deploy
|
15
|
+
attr_accessor :heroku_deploy, :staging_app, :production_app
|
17
16
|
|
18
|
-
def initialize
|
17
|
+
def initialize( options = {} )
|
19
18
|
Rake.application.heroku_deploy_tasks = self
|
20
19
|
|
20
|
+
@staging_app = options.delete(:staging_app)
|
21
|
+
@production_app = options.delete(:production_app)
|
22
|
+
|
21
23
|
define
|
22
24
|
end
|
23
25
|
|
@@ -25,25 +27,48 @@ class HerokuDeploy
|
|
25
27
|
namespace :heroku_deploy do
|
26
28
|
desc 'Setup branches and apps on heroku'
|
27
29
|
task :setup => :environment do
|
28
|
-
|
30
|
+
|
31
|
+
puts ""
|
32
|
+
puts "Creating staging branch"
|
33
|
+
puts ""
|
34
|
+
`git branch staging`
|
35
|
+
`git checkout staging`
|
36
|
+
`git push origin origin:refs/heads/staging`
|
37
|
+
|
38
|
+
puts ""
|
39
|
+
puts "Creating production branch"
|
40
|
+
puts ""
|
41
|
+
`git branch production`
|
42
|
+
`git checkout production`
|
43
|
+
`git push origin origin:refs/heads/production`
|
44
|
+
|
45
|
+
`git checkout master`
|
46
|
+
|
47
|
+
puts ""
|
48
|
+
puts "Creating #{staging_app} Heroku app"
|
49
|
+
puts ""
|
50
|
+
`heroku app:create #{staging_app}`
|
51
|
+
|
52
|
+
puts ""
|
53
|
+
puts "Creating #{production_app} Heroku app"
|
54
|
+
puts ""
|
55
|
+
`heroku app:create #{production_app}`
|
56
|
+
|
57
|
+
puts ""
|
58
|
+
puts "Setup Complete!"
|
59
|
+
puts ""
|
60
|
+
|
29
61
|
end
|
30
62
|
|
31
63
|
desc 'Deploy changes to staging'
|
32
64
|
task :staging => :environment do
|
33
65
|
|
34
|
-
|
66
|
+
backup( staging_app )
|
35
67
|
|
36
68
|
puts "Deploying to Staging"
|
37
|
-
|
38
|
-
|
39
|
-
`git checkout master`
|
40
|
-
`git pull origin master`
|
41
|
-
`git checkout staging`
|
42
|
-
`git pull origin staging`
|
43
|
-
`git merge master`
|
44
|
-
`git push origin staging`
|
69
|
+
merge( "master", "staging" )
|
45
70
|
|
46
|
-
heroku_deploy.push_to 'staging'
|
71
|
+
heroku_deploy.push_to 'staging', staging_app
|
47
72
|
puts ""
|
48
73
|
puts "Staging Deployed!"
|
49
74
|
puts ""
|
@@ -52,19 +77,12 @@ class HerokuDeploy
|
|
52
77
|
desc 'Deploy changes to production'
|
53
78
|
task :production => :environment do
|
54
79
|
|
55
|
-
|
80
|
+
backup( production_app )
|
56
81
|
|
57
82
|
puts "Deploying to Production"
|
58
|
-
|
83
|
+
merge( "staging", "production" )
|
59
84
|
|
60
|
-
|
61
|
-
`git pull origin staging`
|
62
|
-
`git checkout production`
|
63
|
-
`git pull origin production`
|
64
|
-
`git merge staging`
|
65
|
-
`git push origin production`
|
66
|
-
|
67
|
-
heroku_deploy.push_to 'production'
|
85
|
+
heroku_deploy.push_to 'production', production_app
|
68
86
|
|
69
87
|
puts ""
|
70
88
|
puts "Production Deployed!"
|
@@ -86,10 +104,18 @@ class HerokuDeploy
|
|
86
104
|
end
|
87
105
|
end
|
88
106
|
|
89
|
-
def
|
107
|
+
def merge(from_branch, to_branch)
|
108
|
+
puts "Merging #{from_branch} with #{to_branch}"
|
109
|
+
|
110
|
+
`git checkout #{from_branch}`
|
111
|
+
`git pull origin #{from_branch}`
|
112
|
+
`git checkout #{to_branch}`
|
113
|
+
`git pull origin #{to_branch}`
|
114
|
+
`git merge #{from_branch}`
|
115
|
+
`git push origin #{to_branch}`
|
116
|
+
end
|
90
117
|
|
91
|
-
|
92
|
-
app = "grouppay-staging" if branch == "staging"
|
118
|
+
def push_to( branch, app )
|
93
119
|
|
94
120
|
puts "Going into maintenance mode"
|
95
121
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: heroku_deploy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 6
|
10
|
+
version: 0.0.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ross Hale
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2010-
|
19
|
+
date: 2010-07-12 00:00:00 -07:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
@@ -43,11 +43,9 @@ extra_rdoc_files:
|
|
43
43
|
- README.markdown
|
44
44
|
files:
|
45
45
|
- .gitignore
|
46
|
-
- .idea/dictionaries/rosshale.xml
|
47
46
|
- README.markdown
|
48
47
|
- Rakefile
|
49
48
|
- VERSION
|
50
|
-
- config/heroku_deploy.yml
|
51
49
|
- heroku_deploy.gemspec
|
52
50
|
- lib/heroku_deploy.rb
|
53
51
|
- lib/heroku_deploy/tasks.rb
|