capistrano_recipes 1.0.4 → 1.0.5

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YTBhNzUwMzc5MWQxZTgyYzE1MGY2NDZlOTgzZWI2N2QyYWY5YzAyZQ==
4
+ ZDQ0OTc5NzU4YjFlYjdmMjg5YzcyYWQ3MjBiZmI5Nzg1MWNhYTMxMw==
5
5
  data.tar.gz: !binary |-
6
- NTI5MDc5MTM1M2U4MzM1OTNkN2VhNGI2OWU2Mjg2MGY0MTlhYzUzYQ==
6
+ N2U2ZjM3Y2RhOTgwNmM0YWE1YzM3YWUyMDkzMWVmZTczODhkMjQwMA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- YzIyMTAwMTU1ZjA5YmQ4MGZjNmRmMDA0NmYxMzA3NTRjMjNjYTJjODAxNzRj
10
- ZmQzNmM4OGJjOTYxMWRmN2RlYTYzOTJjM2Q0NGE5ZGEwOTQ4ODAxMDBhZTE2
11
- MTdiYzkwMTZhZGU1NDVlZDRjMzgzNDI5NjY3MmM2MzQ3YTRmYzI=
9
+ MGJiM2Y0NTY0OGEwNGQzYjllMTIwZWEwZjkzM2QxYmRhMTEyMGI2YWRjMTdh
10
+ MTcxNTg5MjM4NzNlYzE5Y2M3N2RlNDIyOTZhNzk4NWNkMjFjYzJmZjdhMjkz
11
+ OTNlYmJmZjdjMGY4NmQxNmZjMTc2MjM5Y2ZmYzMxNjVkYmEwN2I=
12
12
  data.tar.gz: !binary |-
13
- ZTc0ODllNTJkOGMzNmE1ZGU3OTVkYWQ4YTZlZTM1NjhjMTMwNjMxYjlhYTFk
14
- OGFlZDYzYmE0Yzg2NTllNGU5ODVmYTY0OGIxMWUwMjdiNWNkYmFhNGRjZmU5
15
- NGUyMGY0ZTMxZjg3ZGQzYzgyNmJiMTJlMTQxMjRmYWEyYWIzNjE=
13
+ ZDgzM2IwMTRkNTQ2OTczOGIzZTZmOWQwYzk4OGFhMGE3ZTgwNWZjYWRiMGRk
14
+ YTUyM2NjZDdlYzIzNmU0YzdmZjQwZDA5YWI0NTU3NzI1YzJlMWQzODVlZGVm
15
+ OTcwYmFhYjk4NTllOTZlN2EwNzE5NDFhOGY4OTgyOGI2NmFjZmY=
data/CHANGELOG.md ADDED
@@ -0,0 +1,26 @@
1
+ # 1.0.5 - May 21, 2013
2
+ - Added remote_directory_exists? and remote_file_exists? methods
3
+ - Fixed bug to check if git repo already exists during setup in git recipe
4
+
5
+ # 1.0.4 - May 21, 2013
6
+ - Fixed bug when creating database in mysql recipe
7
+ - Fixed bug when creating database name in mysql.yml.erb template
8
+
9
+ # 1.0.3 - May 20, 2013
10
+ - Fixed bug to set shared_children in Proc
11
+ - Added start to cold task in git recipe
12
+
13
+ # 1.0.2 - May 19, 2013
14
+ - Fixed bug in git recipe to go to current_path instead of deploy_to path
15
+ - Updated git spec test
16
+ - Fixed syntax in mysql recipe
17
+ - Added creating pids_path and sockets_path on setup
18
+ - Fixed syntax in nginx.vhost.erb template
19
+ - Fixed bug in use_recipe
20
+ - Fixed bug when naming recipes with underscore
21
+
22
+ # 1.0.1 - May 19, 2013
23
+ - Fixed syntax in nginx.vhost.erb template
24
+
25
+ # 1.0.0 - May 18, 2013
26
+ - Initial release
data/README.md CHANGED
@@ -80,6 +80,9 @@ Or install it yourself as:
80
80
  ## Documentation
81
81
  For more detailed information, visit the [wiki](https://github.com/fernandoaleman/capistrano_recipes/wiki).
82
82
 
83
+ ## Changelog
84
+ Look at the [CHANGELOG](https://github.com/fernandoaleman/capistrano_recipes/blob/master/CHANGELOG.md) to see what's changed.
85
+
83
86
  ## Contributing
84
87
 
85
88
  1. Fork it
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = 'capistrano_recipes'
7
- s.version = '1.0.4'
7
+ s.version = '1.0.5'
8
8
  s.authors = ['Fernando Aleman']
9
9
  s.email = ['fernandoaleman@mac.com']
10
10
  s.description = 'Capistrano recipes to make your deployments fast and easy'
@@ -20,13 +20,20 @@ module CapistranoRecipes
20
20
  set(:current_revision) { capture("cd #{current_path} && git rev-parse --short HEAD").strip }
21
21
  set(:latest_revision) { capture("cd #{current_path} && git rev-parse --short HEAD").strip }
22
22
  set(:previous_revision) { capture("cd #{current_path} && git rev-parse --short HEAD@{1}").strip }
23
-
23
+
24
24
  set :local_branch do
25
25
  `git symbolic-ref HEAD 2> /dev/null`.strip.sub('refs/heads/', '')
26
26
  end
27
27
 
28
28
  after 'deploy:setup' do
29
- run "git clone --no-checkout #{repository} #{current_path}"
29
+ begin
30
+ run "git clone --no-checkout #{repository} #{current_path}"
31
+ rescue
32
+ if agree?("Repo already exists. Destroy and clone again?")
33
+ run "#{try_sudo} rm -rf #{current_path}"
34
+ retry
35
+ end
36
+ end
30
37
  end
31
38
 
32
39
  namespace :deploy do
@@ -89,6 +89,36 @@ module CapistranoRecipes
89
89
  m = "\n#{message}"
90
90
  Capistrano::CLI.ui.say(m)
91
91
  end
92
+
93
+ def remote_directory_exists?(path)
94
+ remote_item_exists?(path, 'd')
95
+ end
96
+
97
+ def remote_file_exists?(path)
98
+ remote_item_exists?(path, 'f')
99
+ end
100
+
101
+ def remote_item_exists?(path, item)
102
+ results = false
103
+ check = nil
104
+
105
+ case item
106
+ when 'file', 'f'
107
+ check = 'f'
108
+ when 'directory', 'd'
109
+ check = 'd'
110
+ end
111
+
112
+ unless check.nil?
113
+ invoke_command("if [[ -#{check} #{path} ]]; then echo -n 'true'; fi") do |channel, stream, data|
114
+ results = results || (data == 'true')
115
+ end
116
+ else
117
+ abort "No item '#{item}' option exists"
118
+ end
119
+
120
+ results
121
+ end
92
122
 
93
123
  namespace :deploy do
94
124
  desc 'Deploy application'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano_recipes
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fernando Aleman
@@ -62,6 +62,7 @@ files:
62
62
  - .gitignore
63
63
  - .rspec
64
64
  - .travis.yml
65
+ - CHANGELOG.md
65
66
  - Gemfile
66
67
  - LICENSE.txt
67
68
  - README.md