ratchetify 1.0.4 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1a4b8fdc1b6691a5ca19a8c95f91378178668bf7
4
- data.tar.gz: e301d5942f39c709b69c8f434dab192d63882fae
3
+ metadata.gz: a76ccc5d84132a339b64b9f4c05e432f008300f8
4
+ data.tar.gz: 5604850d28b106ddeaaf5de947d8a69952c1c679
5
5
  SHA512:
6
- metadata.gz: 7d620f93eee909490c77afcb898ef4842997f91cbe23a058c15e559dc2de18b125142c68f19489f0437fd2e0e5a2d25cb9aaf97da8f9459976cfca4135ce29e2
7
- data.tar.gz: ce3371bd8f427d0113de5a38db17d00d20784af94a999a6961cae738534aecf3944fa7d3c82a7edc1e905357e090094fd7caf1edbad592fdb1898916152b0476
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
@@ -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"
@@ -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"
@@ -1,3 +1,3 @@
1
1
  module Ratchetify
2
- VERSION = "1.0.4"
2
+ VERSION = "1.0.6"
3
3
  end
data/lib/ratchetify.rb CHANGED
@@ -14,6 +14,7 @@ Capistrano::Configuration.instance.load do
14
14
  require 'ratchetify/php'
15
15
  require 'ratchetify/update'
16
16
  require 'ratchetify/db'
17
+ require 'ratchetify/git'
17
18
  require 'ratchetify/help' # monkey patched from capistrano
18
19
 
19
20
  # host and domain for the new app
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
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-04-26 00:00:00.000000000 Z
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