dpl 1.8.15.travis.1375.4 → 1.8.15.travis.1378.4

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
- NWQwZGU5MzNjODMyNGRmYjRlOGM0YjJkNGUxNzYxM2M5OTA4YzQzMQ==
4
+ NWY5NWM2NDM0OWM4YzE4Zjg1NjY4MzVlMjE3MzFmY2FhZWZjODcwZQ==
5
5
  data.tar.gz: !binary |-
6
- NzI4ZjU1MDA4ODM0YmFkNWE4MjFiMzYxNmNiMzBmZTJmMzY1NzkxZA==
6
+ MGJjYjU5NWUzOTUzM2U4MGNhM2M4YTE4ZTViOGM1MmZmOTIyOTA0Yw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YzMwMzYwMzRjZDZmZmU0YWEyMDcyNzM2OTBkMDlhOGNmMjYyMjU5MzE3ODBi
10
- NjIxMWViMWZjODk1MDFmM2FhODk1MGE5NDBkNWZkMDI5OTFiN2ExZjk1ZTI5
11
- ZDA4Y2M5MmY5MjEzYjc4ZDdhM2JlMDVlNjc2ZTJjMWE2YTRkNjA=
9
+ M2I3M2JmMjNmYzQ1NGVjNTU1OWVlYjFkZWU0NmI3ZmE4NDBhYTJhOGUxMWEw
10
+ ZTQwNWQ1MWFjMjY4YTg5NTExM2RmYzYxYmEwMzBlYjljMjRlMTUwYjQ3MzI2
11
+ NDE2ZDc4OTc1M2IxMzEwY2I0ZDkyODcxZTRiNDA4MGI5NmQxMTU=
12
12
  data.tar.gz: !binary |-
13
- MWZmOTgzNjM0YTFkODA5YmE0YmJjY2I2YWQ0YjNhOGM2OWNkYTAxZTQzNGIw
14
- ZDZmMWYxNmI0ODE1NWY2ODU3NzkwOTNlYTFkYjQxNDFlOWNiZWM2MGE4NmU3
15
- OTYwYmE0OWM4MWI0ODk3YzQyYTkzYzY4N2FkYWRhNDYyMTQ1ZGI=
13
+ N2EyMzZlNGFlNWUwMGY1ZjQ5Y2EwODA1ZjMyNjJlNDliYTZjNTlmYTQxNzgx
14
+ ZDI3MzBlMzEyMzkxNTE3M2E1MzBhYTE0ODUxMGVhZGZhMTZkY2IzNmUwOGRj
15
+ MDkxNzgzMDA0YWY1MDU2OWMzODVjNTcwNmY4NTRjMDFlODM3MGU=
data/Gemfile CHANGED
@@ -82,3 +82,7 @@ end
82
82
  group :chef_supermarket do
83
83
  gem 'chef'
84
84
  end
85
+
86
+ group :deis do
87
+ gem 'git'
88
+ end
@@ -1,6 +1,9 @@
1
1
  module DPL
2
2
  class Provider
3
3
  class Deis < Provider
4
+
5
+ requires 'git'
6
+
4
7
  def install_deploy_dependencies
5
8
  context.shell "curl -sSL http://deis.io/deis-cli/install.sh | sh -s #{option(:cli_version)}"
6
9
  end
@@ -44,6 +47,31 @@ module DPL
44
47
  unless context.shell "./deis git:remote --app=#{option(:app)}"
45
48
  error 'Adding git remote failed.'
46
49
  end
50
+
51
+ wait_for_git_access
52
+ end
53
+
54
+ def wait_for_git_access()
55
+ retry_count=0
56
+ max_retries=30
57
+
58
+ #Get the deis git remote host and port
59
+ git=Git.open("./")
60
+ git_remote=git.remote("deis").url
61
+ remote_uri=git_remote.split("ssh://")[1].split("/")[0]
62
+ remote_host, remote_port = remote_uri.split(":")
63
+ puts "Git remote is #{remote_host} at port #{remote_port}"
64
+
65
+ #Try and connect to the github remote via ssh.
66
+ while retry_count < max_retries
67
+ puts "Waiting for ssh key to propagate..."
68
+ if context.shell "#{context.env['GIT_SSH']} #{remote_host} -p #{remote_port} 2>&1 | grep -c 'PTY allocation request failed' > /dev/null"
69
+ puts "SSH connection established."
70
+ break
71
+ end
72
+ retry_count += 1
73
+ sleep(1)
74
+ end
47
75
  end
48
76
 
49
77
  def remove_key
@@ -67,6 +67,21 @@ describe DPL::Provider::Deis do
67
67
  expect(provider.context).to receive(:shell).with(
68
68
  './deis git:remote --app=example'
69
69
  ).and_return(true)
70
+
71
+ git_conf = double
72
+ git_remote = double
73
+ allow(Git).to receive(:open).and_return(git_conf)
74
+ allow(git_conf).to receive(:remote).and_return(git_remote)
75
+ allow(git_remote).to receive(:url).and_return("ssh://git@fake-git-repo.travis-ci.com:2222/dpl-test.git")
76
+
77
+ expect(provider.context).to receive(:shell).with(
78
+ /grep -c 'PTY allocation request failed'/
79
+ ).and_return(false)
80
+
81
+ expect(provider.context).to receive(:shell).with(
82
+ /grep -c 'PTY allocation request failed'/
83
+ ).and_return(true)
84
+
70
85
  provider.setup_git_ssh('foo', 'key_file')
71
86
  end
72
87
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dpl
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.15.travis.1375.4
4
+ version: 1.8.15.travis.1378.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Haase