bonethug 0.0.22 → 0.0.23

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.
data/config/deploy.rb CHANGED
@@ -3,6 +3,7 @@
3
3
  # - implement a cleanup task when a deploy fails - its not good if the apache conf gets malformed
4
4
  # - review directory permissions
5
5
  # - passenger executes rails as the user that owns evironment.rb - if root owns it it runs as nobody
6
+ # - certain parts break if it can't find the config entries - should just check for them and skip if it can't find them
6
7
 
7
8
  # Requires
8
9
  # ---------------------------------------------------------------
@@ -39,7 +40,7 @@ use_composer = ['silverstripe','silverstripe3','drupal','php'].include? deploy.g
39
40
 
40
41
  # directories we need to track
41
42
  resources += ['backups']
42
- resources.push 'vendor' if use_composer
43
+ # resources.push 'vendor' if use_composer
43
44
 
44
45
  # logs
45
46
  log_dirs.push 'log' unless log_dirs.include? 'log'
@@ -124,21 +125,28 @@ task :backup => :environment do
124
125
  end
125
126
 
126
127
  desc "Syncs files to a location"
127
- task :sync_to => :environment do
128
+ task :sync_from => :environment do
128
129
  if rsync = conf.get('backup.rsync')
129
- rsync = conf.get('backup.rsync')
130
- path = deploy.get('project_slug') + "_" + env + "_backup/sync"
131
- queue! %[cd #{deploy_to}/current && rsync -r -a -v -e "ssh -l #{rsync.user}" --delete . #{rsync.host}:/#{path}/ ]
130
+ path = deploy.get('project_slug') + "_" + env + "_sync"
131
+ ssh_pass = rsync.get('pass') ? "sshpass -p #{rsync.get('pass')}" : ""
132
+ queue! %[#{ssh_pass} ssh #{rsync.get('user')}@#{rsync.get('host')} mkdir -p #{path}]
133
+ (resources + log_dirs).each do |item|
134
+ queue! %[cd #{deploy_to}/current && rsync -r -a -v -e "#{ssh_pass} ssh -l #{rsync.get('user')}" --delete --copy-dirlinks ./#{item} #{rsync.get('host')}:#{path}/]
135
+ end
132
136
  else
133
137
  raise 'no rsync conf'
134
138
  end
135
139
  end
136
140
 
137
141
  desc "Restores files from a location"
138
- task :sync_from => :environment do
142
+ task :sync_to => :environment do
139
143
  if rsync = conf.get('backup.rsync')
140
- path = deploy.get('project_slug') + "_" + env + "_backup/sync"
141
- queue! %[cd #{deploy_to}/current && rsync -r -a -v -e "ssh -l #{rsync.user}" --delete #{rsync.host}:/#{path}/ .]
144
+ path = deploy.get('project_slug') + "_" + env + "_sync"
145
+ ssh_pass = rsync.get('pass') ? "sshpass -p #{rsync.get('pass')}" : ""
146
+ queue! %[#{ssh_pass} ssh #{rsync.get('user')}@#{rsync.get('host')} mkdir -p #{path}]
147
+ (resources + log_dirs).each do |item|
148
+ queue! %[cd #{deploy_to}/current && rsync -r -a -v -e "#{ssh_pass} ssh -l #{rsync.get('user')}" --delete --copy-dirlinks #{rsync.get('host')}:#{path}/#{item} ./]
149
+ end
142
150
  else
143
151
  raise 'no rsync conf'
144
152
  end
@@ -265,7 +265,7 @@ module Bonethug
265
265
  end
266
266
 
267
267
  # run bundler
268
- exec 'bundle install --path vendor --binstubs'
268
+ exec 'bundle install --path vendor --binstubs' + (mode == :update ? ' && bundle update bonethug' : '')
269
269
 
270
270
  # self
271
271
 
@@ -1,3 +1,3 @@
1
1
  module Bonethug
2
- VERSION = "0.0.22"
2
+ VERSION = "0.0.23"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bonethug
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.22
4
+ version: 0.0.23
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-09-02 00:00:00.000000000 Z
12
+ date: 2013-09-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler