ratchetify 1.0.4 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ratchetify/git.rb +48 -0
- data/lib/ratchetify/rails.rb +2 -18
- data/lib/ratchetify/update.rb +2 -17
- data/lib/ratchetify/version.rb +1 -1
- data/lib/ratchetify.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a76ccc5d84132a339b64b9f4c05e432f008300f8
|
4
|
+
data.tar.gz: 5604850d28b106ddeaaf5de947d8a69952c1c679
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b07f528704f0fb8294b59c00df9e86c186e60af260e917135b092420a6dd26966115085fd22f325e6f25c638c0f7c155d56d863240918e47e647402d4186ed00
|
7
|
+
data.tar.gz: d489bf3acf6e5a96be62a8a58f7b23f66828fdc531c475cedadb685afae60652a13cf4918b8b2f412e5254ded05bee591032bf09d8b87e393f354564bd1ce2aa
|
@@ -0,0 +1,48 @@
|
|
1
|
+
|
2
|
+
Capistrano::Configuration.instance.load do
|
3
|
+
|
4
|
+
require 'capistrano'
|
5
|
+
require 'ratchetify/helpers'
|
6
|
+
|
7
|
+
desc "Create and update repositories"
|
8
|
+
namespace :git do
|
9
|
+
|
10
|
+
desc "Clone a repository"
|
11
|
+
task :clone_repo do
|
12
|
+
# clone the repo first
|
13
|
+
git_cmd = "cd #{deploy_root} && git clone #{fetch :repo} #{fetch :application}"
|
14
|
+
|
15
|
+
run git_cmd do |channel, stream, out|
|
16
|
+
if out =~ /Password:/
|
17
|
+
channel.send_data("#{fetch :repo_password}\n")
|
18
|
+
else
|
19
|
+
puts out
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
# switch to the specified branch
|
24
|
+
run "cd #{deploy_dir} && git checkout -b #{fetch :branch}" unless on_branch? deploy_dir, "#{fetch :branch}"
|
25
|
+
|
26
|
+
end # task :create
|
27
|
+
|
28
|
+
desc "Update a repository"
|
29
|
+
task :update_repo do
|
30
|
+
# switch to the specified branch
|
31
|
+
run "cd #{deploy_dir} && git checkout -b #{fetch :branch}" unless on_branch? deploy_dir, "#{fetch :branch}"
|
32
|
+
|
33
|
+
# update the repo
|
34
|
+
git_cmd = "cd #{deploy_dir} && git pull origin #{fetch :branch}"
|
35
|
+
|
36
|
+
run git_cmd do |channel, stream, out|
|
37
|
+
if out =~ /Password:/
|
38
|
+
channel.send_data("#{fetch :repo_password}\n")
|
39
|
+
else
|
40
|
+
puts out
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
end # end update
|
45
|
+
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
data/lib/ratchetify/rails.rb
CHANGED
@@ -7,8 +7,10 @@ Capistrano::Configuration.instance.load do
|
|
7
7
|
require 'ratchetify/domain'
|
8
8
|
require 'ratchetify/service'
|
9
9
|
require 'ratchetify/db'
|
10
|
+
require 'ratchetify/git'
|
10
11
|
|
11
12
|
before "create:rails", "setup:environment"
|
13
|
+
before "create:rails", "git:clone_repo"
|
12
14
|
before "create:rails", "db:create"
|
13
15
|
after "create:rails", "service:create"
|
14
16
|
after "create:rails", "service:create_reverse_proxy"
|
@@ -19,28 +21,10 @@ Capistrano::Configuration.instance.load do
|
|
19
21
|
|
20
22
|
desc "Deploy a RAILS app to uberspace"
|
21
23
|
task :rails do
|
22
|
-
create_repo
|
23
24
|
config_rails_app
|
24
25
|
finalize
|
25
26
|
end
|
26
27
|
|
27
|
-
task :create_repo do
|
28
|
-
# clone the repo first
|
29
|
-
git_cmd = "cd #{deploy_root} && git clone #{fetch :repo} #{fetch :application}"
|
30
|
-
|
31
|
-
run git_cmd do |channel, stream, out|
|
32
|
-
if out =~ /Password:/
|
33
|
-
channel.send_data("#{fetch :repo_password}\n")
|
34
|
-
else
|
35
|
-
puts out
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
# switch to the specified branch
|
40
|
-
run "cd #{deploy_dir} && git checkout -b #{fetch :branch}" unless on_branch? deploy_dir, "#{fetch :branch}"
|
41
|
-
|
42
|
-
end # task :create_repo
|
43
|
-
|
44
28
|
task :config_rails_app do
|
45
29
|
# run bundle install first
|
46
30
|
run "cd #{deploy_dir} && bundle install --path ~/.gem"
|
data/lib/ratchetify/update.rb
CHANGED
@@ -4,8 +4,10 @@ Capistrano::Configuration.instance.load do
|
|
4
4
|
require 'capistrano'
|
5
5
|
require 'ratchetify/helpers'
|
6
6
|
require 'ratchetify/service'
|
7
|
+
require 'ratchetify/git'
|
7
8
|
|
8
9
|
before :update, "service:stop"
|
10
|
+
before :update, "git:update_repo"
|
9
11
|
after :update, "service:start"
|
10
12
|
|
11
13
|
desc "Tasks to update an app"
|
@@ -13,23 +15,6 @@ Capistrano::Configuration.instance.load do
|
|
13
15
|
|
14
16
|
desc "Stop the service, update the app then restart"
|
15
17
|
task :default do
|
16
|
-
# switch to the specified branch
|
17
|
-
run "cd #{deploy_dir} && git checkout -b #{fetch :branch}" unless on_branch? deploy_dir, "#{fetch :branch}"
|
18
|
-
|
19
|
-
# update the repo
|
20
|
-
git_cmd = "cd #{deploy_dir} && git pull origin #{fetch :branch}"
|
21
|
-
|
22
|
-
run git_cmd do |channel, stream, out|
|
23
|
-
if out =~ /Password:/
|
24
|
-
channel.send_data("#{fetch :repo_password}\n")
|
25
|
-
else
|
26
|
-
puts out
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
#
|
31
|
-
# typical RAILS stuff to finalize
|
32
|
-
#
|
33
18
|
|
34
19
|
# run bundle install first
|
35
20
|
run "cd #{deploy_dir} && bundle install --path ~/.gem"
|
data/lib/ratchetify/version.rb
CHANGED
data/lib/ratchetify.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ratchetify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Kuehl
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|
@@ -58,6 +58,7 @@ files:
|
|
58
58
|
- lib/ratchetify/base.rb
|
59
59
|
- lib/ratchetify/db.rb
|
60
60
|
- lib/ratchetify/domain.rb
|
61
|
+
- lib/ratchetify/git.rb
|
61
62
|
- lib/ratchetify/help.rb
|
62
63
|
- lib/ratchetify/helpers.rb
|
63
64
|
- lib/ratchetify/php.rb
|