dpl 1.8.15.travis.1375.4 → 1.8.15.travis.1378.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/Gemfile +4 -0
- data/lib/dpl/provider/deis.rb +28 -0
- data/spec/provider/deis_spec.rb +15 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NWY5NWM2NDM0OWM4YzE4Zjg1NjY4MzVlMjE3MzFmY2FhZWZjODcwZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MGJjYjU5NWUzOTUzM2U4MGNhM2M4YTE4ZTViOGM1MmZmOTIyOTA0Yw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
M2I3M2JmMjNmYzQ1NGVjNTU1OWVlYjFkZWU0NmI3ZmE4NDBhYTJhOGUxMWEw
|
10
|
+
ZTQwNWQ1MWFjMjY4YTg5NTExM2RmYzYxYmEwMzBlYjljMjRlMTUwYjQ3MzI2
|
11
|
+
NDE2ZDc4OTc1M2IxMzEwY2I0ZDkyODcxZTRiNDA4MGI5NmQxMTU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
N2EyMzZlNGFlNWUwMGY1ZjQ5Y2EwODA1ZjMyNjJlNDliYTZjNTlmYTQxNzgx
|
14
|
+
ZDI3MzBlMzEyMzkxNTE3M2E1MzBhYTE0ODUxMGVhZGZhMTZkY2IzNmUwOGRj
|
15
|
+
MDkxNzgzMDA0YWY1MDU2OWMzODVjNTcwNmY4NTRjMDFlODM3MGU=
|
data/Gemfile
CHANGED
data/lib/dpl/provider/deis.rb
CHANGED
@@ -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
|
data/spec/provider/deis_spec.rb
CHANGED
@@ -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
|