rsync-deploy 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d7099df327d321811dbc7056ecf72b193192b8f6
4
- data.tar.gz: 20ae2c3b2bbf1efc270f990435d868f1c2725c81
3
+ metadata.gz: 80aa81ee9aefde54415bb913a4a152f65b0d91bb
4
+ data.tar.gz: 363a12926ca9645270994c1f22ac01f04b8bc1d2
5
5
  SHA512:
6
- metadata.gz: adbd2c994dd599b7d93e63e36a6136134971cb9380f7fdc0a261583b2c94c4a7889d0b0fbae8c8b5515a500ea52f6ebe1d65b0f459dbae1b092071a163d71e48
7
- data.tar.gz: 085119d2dbc794f42fb42c92bc98142180341fa9ceea5bd0e483accd4c5b1245003721fa4ae43b7c7eae1bd7b06f514efd62725345fc4e52f0c4e0f97b643e03
6
+ metadata.gz: 7aeec1046f5cf4df6f2cf883c95b3141aecb9902b1150b916331ffc5f4130388b7dc612d599c2fb391e4aa1366fd6199abe6e3832778560efffedeb55252766b
7
+ data.tar.gz: 210c97cc4bef39212a225ffd1508633f4fcc63fbd6d5d132ebc296f8ae309cc827a0d53233103d801683bbc4f33fb6d22204c6b34195cd0252f161c9d3694f0f
data/README.md CHANGED
@@ -132,13 +132,6 @@ The port that the connection should happen over
132
132
 
133
133
  The username to login to the server. If no username is set, your computer account username will be used.
134
134
 
135
- ### pass
136
-
137
- - Type: `String`
138
- - Default: `none`
139
-
140
- The password to login to the server. If SSH keys aren't available, then the `pass` option will be used. If neither SSH keys nor `pass` are set, a prompt will be given.
141
-
142
135
  ### privateKey
143
136
 
144
137
  - Type: `String`
@@ -245,7 +238,7 @@ Deploy is almost identical to [DPLOY](https://github.com/LeanMeanFightingMachine
245
238
 
246
239
  ## Uninstall
247
240
 
248
- To uninstall Deploy, download the [project files](https://github.com/rosszurowski/deploy/archive/master.zip), navigate to the unzipped directory, and run:
241
+ To uninstall Deploy, just run:
249
242
 
250
243
  ```
251
244
  gem uninstall rsync-deploy
data/bin/deploy CHANGED
@@ -59,7 +59,7 @@ def install
59
59
 
60
60
  if(answer == 'y')
61
61
  File.open(Deploy::CONFIG_PATH, 'w+') do |file|
62
- file.puts 'server_name:',' host: ""',' user: ""',' pass: ""',' path:',' local: "/"',' remote: "/public_html/"'
62
+ file.puts 'server_name:',' host: ""',' user: ""',' path:',' local: "/"',' remote: "/public_html/"'
63
63
  end
64
64
  puts "Configuration file `#{Deploy::CONFIG_PATH}` created."
65
65
  else
@@ -69,7 +69,7 @@ def install
69
69
  else
70
70
 
71
71
  File.open(Deploy::CONFIG_PATH, 'w+') do |file|
72
- file.puts 'server_name:',' host: ""',' user: ""',' pass: ""',' path:',' local: "/"',' remote: "/public_html/"'
72
+ file.puts 'server_name:',' host: ""',' user: ""',' path:',' local: "/"',' remote: "/public_html/"'
73
73
  end
74
74
  puts "Configuration file `#{Deploy::CONFIG_PATH}` created."
75
75
 
@@ -12,14 +12,13 @@ module Deploy
12
12
  def initialize(name, hash)
13
13
 
14
14
  @name = name
15
- @config = { :host => '', :port => '', :user => '', :pass => '', :private_key => '', :local => '', :remote => '' }
15
+ @config = { :host => '', :port => '', :user => '', :private_key => '', :local => '', :remote => '' }
16
16
  @options = { :verbose => false, :sync => true }
17
17
 
18
18
  @config[:host] = hash['host']
19
19
  @config[:port] = hash['port'] || '22'
20
20
 
21
21
  @config[:user] = hash['user'] || ''
22
- @config[:pass] = hash['pass'] || ''
23
22
  @config[:private_key] = hash['privateKey'] || ''
24
23
 
25
24
  @config[:local] = hash['path']['local'].gsub(/\s+/, "")
@@ -58,15 +57,10 @@ module Deploy
58
57
  end
59
58
  # Don't upload the deploy configuration file
60
59
  tmp_exclude.puts Deploy::CONFIG_PATH
60
+ tmp_exclude.puts ".git" # Never sync git files
61
61
  tmp_exclude.close
62
62
  end
63
63
 
64
- unless @config[:pass].empty?
65
- tmp_pass = Tempfile.new(['pass','.txt'])
66
- tmp_pass.puts @config[:pass]
67
- tmp_pass.close
68
- end
69
-
70
64
  rsync_cmd = 'rsync -a' # Always keep permissions
71
65
  rsync_cmd += 'v' if @options[:verbose] # Verbose if requested
72
66
  rsync_cmd += 'z' # Always zip files
@@ -77,14 +71,10 @@ module Deploy
77
71
  rsync_cmd += ' --force --delete --delete-excluded' # Sync unless explicitly requested or downloading
78
72
  end
79
73
  rsync_cmd += " --exclude-from=#{tmp_exclude.path}" unless @config[:excludes].empty? # Include exclude file if it exists
80
- rsync_cmd += " --password-file=#{tmp_pass.path}" unless @config[:pass].empty? # Include password file if it exists
81
- rsync_cmd += " -e \"ssh "
82
74
 
83
- if(@config[:pass].empty? and @config[:private_key].empty?)
84
- rsync_cmd += " -i #{@config[:private_key]} " # Include a custom private key if requested
85
- end
86
-
87
- rsync_cmd += "-p#{@config[:port]}\" " # Choose port if specified
75
+ rsync_cmd += " -e \"ssh " # Pass custom ssh options
76
+ rsync_cmd += " -i #{@config[:private_key]} " unless @config[:private_key].empty? # Include a custom private key if requested
77
+ rsync_cmd += "-p #{@config[:port]}\" " # Choose port if specified
88
78
 
89
79
  unless @options[:reverse]
90
80
  rsync_cmd += `pwd`.gsub(/\s+/, "") + "#{@config[:local]} " # The local path from the current directory
@@ -102,9 +92,8 @@ module Deploy
102
92
  # puts rsync_cmd
103
93
  system(rsync_cmd)
104
94
 
105
- # Remove excludes/pass file if needed
95
+ # Remove excludes file if needed
106
96
  tmp_exclude.unlink unless @config[:excludes].empty?
107
- tmp_pass.unlink unless @config[:pass].empty?
108
97
 
109
98
  end
110
99
 
@@ -112,7 +101,7 @@ module Deploy
112
101
 
113
102
  def validate
114
103
 
115
- # Fail without hostname (user/password are optional)
104
+ # Fail without hostname (username is optional)
116
105
  (puts "Error: no hostname set for `#{@name}`"; exit;) if @config[:host].empty?
117
106
 
118
107
  # Fail if local/remote paths not set (because they should be in initialize
@@ -1,5 +1,5 @@
1
1
  module Deploy
2
2
 
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
 
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rsync-deploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ross Zurowski