git-deploy 0.6.1 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 0a6cd9239e4c0ed5487001d0b032bcc75dad6b1ee47ffff60c007f1779cd28aa
4
+ data.tar.gz: acdc7b0a118ecd76d582a794fe578f0b55c5290a959cb7f24fcb6a6f3f8e1183
5
+ SHA512:
6
+ metadata.gz: 6d15238e1f83ab539f5571915ee574ab9afc7654a0548111ea768fbec1f053e4c950c9fbdbefe8a1a63e401a4fbb1488363757a9085a5dc013897884aa1d107b
7
+ data.tar.gz: 317303faddb9a98b0a12341a32d245eebcaebb3294b7820010d5937ca968343872edddab97bd51fa0d80b686c9b163cadecafa42cbe32325736331e06b223672
@@ -125,7 +125,7 @@ Extra commands
125
125
  * `git deploy restart` - Runs the `deploy/restart` callback
126
126
 
127
127
  * `git deploy rollback` - Undo a deploy by checking out the previous revision,
128
- runs `deploy/callback` if exists instead of `deploy/after_push`
128
+ runs `deploy/rollback` if exists instead of `deploy/after_push`
129
129
 
130
130
  * `git deploy upload <files>` - Copy local files to the remote app
131
131
 
@@ -9,7 +9,16 @@ class GitDeploy
9
9
  extend Forwardable
10
10
  def_delegator :remote_url, :host
11
11
  def_delegator :remote_url, :port, :remote_port
12
- def_delegator :remote_url, :path, :deploy_to
12
+
13
+ def deploy_to
14
+ @deploy_to ||= begin
15
+ if remote_url.path.start_with? '/~/'
16
+ remote_url.path[1..-1]
17
+ else
18
+ remote_url.path
19
+ end
20
+ end
21
+ end
13
22
 
14
23
  def remote_user
15
24
  @user ||= begin
@@ -35,7 +44,7 @@ class GitDeploy
35
44
 
36
45
  def remote_urls(remote)
37
46
  git_config["remote -v"].to_s.split("\n").
38
- select {|l| l =~ /^#{remote}\t/ }.
47
+ select {|l| l =~ /^#{remote}\t.+/ }.
39
48
  map {|l| l.split("\t")[1].sub(/\s+\(.+?\)$/, '') }
40
49
  end
41
50
 
@@ -93,7 +93,7 @@ class GitDeploy
93
93
 
94
94
  def ssh_connection
95
95
  @ssh ||= begin
96
- ssh = Net::SSH.start(host, remote_user, :port => remote_port)
96
+ ssh = Net::SSH.start(host, remote_user, :port => remote_port || 22)
97
97
  at_exit { ssh.close }
98
98
  ssh
99
99
  end
@@ -21,12 +21,17 @@ end
21
21
  if File.file? 'Rakefile'
22
22
  tasks = []
23
23
 
24
- num_migrations = `git diff #{oldrev} #{newrev} --diff-filter=A --name-only -z db/migrate`.split("\0").size
24
+ if File.exist?('db/migrate')
25
+ num_migrations = `git diff #{oldrev} #{newrev} --diff-filter=A --name-only -z -- db/migrate`.split("\0").size
26
+ else
27
+ num_migrations = 0
28
+ end
29
+
25
30
  # run migrations if new ones have been added
26
31
  tasks << "db:migrate" if num_migrations > 0
27
32
 
28
33
  # precompile assets
29
- changed_assets = `git diff #{oldrev} #{newrev} --name-only -z app/assets`.split("\0")
34
+ changed_assets = `git diff #{oldrev} #{newrev} --name-only -z -- app/assets`.split("\0")
30
35
  tasks << "assets:precompile" if changed_assets.size > 0
31
36
 
32
37
  run "#{rake_cmd} #{tasks.join(' ')} RAILS_ENV=#{RAILS_ENV}" if tasks.any?
@@ -43,6 +43,26 @@ describe GitDeploy::Configuration do
43
43
  its(:remote_user) { should eq('git') }
44
44
  its(:deploy_to) { should eq('/path/to/app') }
45
45
  end
46
+
47
+ context "scp-style with home" do
48
+ before { stub_remote_url 'git@example.com:~/path/to/app' }
49
+
50
+ its(:host) { should eq('example.com') }
51
+ its(:remote_port) { should be_nil }
52
+ its(:remote_user) { should eq('git') }
53
+ its(:deploy_to) { should eq('~/path/to/app') }
54
+ end
55
+
56
+ context "pushurl only" do
57
+ before {
58
+ remote = options.fetch(:remote)
59
+ url = 'git@example.com:/path/to/app'
60
+ stub_git_config("remote -v", "#{remote}\t\n#{remote}\t#{url} (push)")
61
+ }
62
+
63
+ its(:host) { should eq('example.com') }
64
+ its(:remote_user) { should eq('git') }
65
+ end
46
66
  end
47
67
 
48
68
  end
metadata CHANGED
@@ -1,64 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-deploy
3
3
  version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 0.6.1
4
+ version: 0.7.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Mislav Marohnić
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-09-27 00:00:00.000000000 Z
11
+ date: 2019-03-22 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
- prerelease: false
16
- type: :runtime
17
- version_requirements: !ruby/object:Gem::Requirement
18
- none: false
19
- requirements:
20
- - - '='
21
- - !ruby/object:Gem::Version
22
- version: 0.14.6
23
14
  name: thor
24
15
  requirement: !ruby/object:Gem::Requirement
25
- none: false
26
16
  requirements:
27
17
  - - '='
28
18
  - !ruby/object:Gem::Version
29
19
  version: 0.14.6
30
- - !ruby/object:Gem::Dependency
31
- prerelease: false
32
20
  type: :runtime
21
+ prerelease: false
33
22
  version_requirements: !ruby/object:Gem::Requirement
34
- none: false
35
23
  requirements:
36
- - - ~>
24
+ - - '='
37
25
  - !ruby/object:Gem::Version
38
- version: 2.6.6
26
+ version: 0.14.6
27
+ - !ruby/object:Gem::Dependency
39
28
  name: net-ssh
40
29
  requirement: !ruby/object:Gem::Requirement
41
- none: false
42
30
  requirements:
43
- - - ~>
31
+ - - "~>"
44
32
  - !ruby/object:Gem::Version
45
- version: 2.6.6
46
- - !ruby/object:Gem::Dependency
47
- prerelease: false
33
+ version: '5.0'
48
34
  type: :runtime
35
+ prerelease: false
49
36
  version_requirements: !ruby/object:Gem::Requirement
50
- none: false
51
37
  requirements:
52
- - - ~>
38
+ - - "~>"
53
39
  - !ruby/object:Gem::Version
54
- version: 1.1.0
40
+ version: '5.0'
41
+ - !ruby/object:Gem::Dependency
55
42
  name: net-scp
56
43
  requirement: !ruby/object:Gem::Requirement
57
- none: false
58
44
  requirements:
59
- - - ~>
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.1'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
60
53
  - !ruby/object:Gem::Version
61
- version: 1.1.0
54
+ version: '1.1'
62
55
  description: A tool to install useful git hooks on your remote repository to enable
63
56
  push-based, Heroku-like deployment on your host.
64
57
  email: mislav.marohnic@gmail.com
@@ -67,41 +60,40 @@ executables:
67
60
  extensions: []
68
61
  extra_rdoc_files: []
69
62
  files:
63
+ - LICENSE
64
+ - README.markdown
70
65
  - bin/git-deploy
66
+ - lib/git_deploy.rb
71
67
  - lib/git_deploy/configuration.rb
72
68
  - lib/git_deploy/generator.rb
73
69
  - lib/git_deploy/ssh_methods.rb
74
70
  - lib/git_deploy/templates/after_push.sh
75
71
  - lib/git_deploy/templates/before_restart.rb
76
72
  - lib/git_deploy/templates/restart.sh
77
- - lib/git_deploy.rb
78
73
  - lib/hooks/post-receive.sh
79
74
  - spec/configuration_spec.rb
80
- - README.markdown
81
- - LICENSE
82
75
  homepage: https://github.com/mislav/git-deploy#readme
83
76
  licenses:
84
77
  - MIT
78
+ metadata: {}
85
79
  post_install_message:
86
80
  rdoc_options: []
87
81
  require_paths:
88
82
  - lib
89
83
  required_ruby_version: !ruby/object:Gem::Requirement
90
- none: false
91
84
  requirements:
92
- - - ! '>='
85
+ - - ">="
93
86
  - !ruby/object:Gem::Version
94
- version: '0'
87
+ version: 2.2.6
95
88
  required_rubygems_version: !ruby/object:Gem::Requirement
96
- none: false
97
89
  requirements:
98
- - - ! '>='
90
+ - - ">="
99
91
  - !ruby/object:Gem::Version
100
92
  version: '0'
101
93
  requirements: []
102
94
  rubyforge_project:
103
- rubygems_version: 1.8.23
95
+ rubygems_version: 2.7.6.2
104
96
  signing_key:
105
- specification_version: 3
97
+ specification_version: 4
106
98
  summary: Simple git push-based application deployment
107
99
  test_files: []