dpl 1.8.26.travis.1771.3 → 1.8.26.travis.1775.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dpl/provider/deis.rb +17 -11
- data/spec/provider/deis_spec.rb +2 -12
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 442f26b778bea17923fc71d68890ca09edd01fa5
|
4
|
+
data.tar.gz: c123a7b359513699f94335e1b25fb37ce87d1f04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9bfb2f9e1c71fc5cfd6ab0b2e5908b442b21f6cb09621920d44e8dd33e52a5990665482e9ee2b9ef4269dedd96e52a3a4d5a8f5e0413e1283489c94a7885a4a
|
7
|
+
data.tar.gz: 9a5acc56187d8c68e17063ce3ef4a60207f7077ffe2e0358f254591a9e2ccdf0728311f471698c60d71a79e21ec907f8bac15e0eb010f664c7eee7f95b8abc22
|
data/lib/dpl/provider/deis.rb
CHANGED
@@ -2,8 +2,6 @@ module DPL
|
|
2
2
|
class Provider
|
3
3
|
class Deis < Provider
|
4
4
|
|
5
|
-
requires 'git'
|
6
|
-
|
7
5
|
def install_deploy_dependencies
|
8
6
|
install_url = determine_install_url
|
9
7
|
context.shell "curl -sSL #{install_url} | bash -x -s #{option(:cli_version)}"
|
@@ -59,10 +57,6 @@ module DPL
|
|
59
57
|
chmod(0740, path)
|
60
58
|
context.env['GIT_SSH'] = path
|
61
59
|
|
62
|
-
unless context.shell "./deis git:remote --app=#{option(:app)}"
|
63
|
-
error 'Adding git remote failed.'
|
64
|
-
end
|
65
|
-
|
66
60
|
wait_for_git_access
|
67
61
|
end
|
68
62
|
|
@@ -71,9 +65,7 @@ module DPL
|
|
71
65
|
max_retries=30
|
72
66
|
|
73
67
|
#Get the deis git remote host and port
|
74
|
-
|
75
|
-
git_remote=git.remote("deis").url
|
76
|
-
remote_uri=git_remote.split("ssh://")[1].split("/")[0]
|
68
|
+
remote_uri=repository_url.split("ssh://")[1].split("/")[0]
|
77
69
|
remote_host, remote_port = remote_uri.split(":")
|
78
70
|
puts "Git remote is #{remote_host} at port #{remote_port}"
|
79
71
|
|
@@ -95,14 +87,28 @@ module DPL
|
|
95
87
|
end
|
96
88
|
end
|
97
89
|
|
90
|
+
def repository_url
|
91
|
+
"ssh://git@#{builder_hostname}:2222/#{option(:app)}.git"
|
92
|
+
end
|
93
|
+
|
94
|
+
def builder_hostname
|
95
|
+
host_tokens = controller_host.split(".")
|
96
|
+
host_tokens[0] = [host_tokens[0], "builder"].join("-")
|
97
|
+
host_tokens.join(".")
|
98
|
+
end
|
99
|
+
|
100
|
+
def controller_host
|
101
|
+
option(:controller).gsub(/https?:\/\//, "").split(":")[0]
|
102
|
+
end
|
103
|
+
|
98
104
|
def push_app
|
99
|
-
unless context.shell "bash -c 'git push #{verbose_flag}
|
105
|
+
unless context.shell "bash -c 'git push #{verbose_flag} #{repository_url} HEAD:refs/heads/master -f 2>&1 | tr -dc \"[:alnum:][:space:][:punct:]\" | sed -E \"s/remote: (\\[1G)+//\" | sed \"s/\\[K$//\"; exit ${PIPESTATUS[0]}'"
|
100
106
|
error 'Deploying application failed.'
|
101
107
|
end
|
102
108
|
end
|
103
109
|
|
104
110
|
def run(command)
|
105
|
-
unless context.shell "./deis run -- #{command}"
|
111
|
+
unless context.shell "./deis run -a #{option(:app)} -- #{command}"
|
106
112
|
error 'Running command failed.'
|
107
113
|
end
|
108
114
|
end
|
data/spec/provider/deis_spec.rb
CHANGED
@@ -64,16 +64,6 @@ describe DPL::Provider::Deis do
|
|
64
64
|
|
65
65
|
describe "#setup_git_ssh" do
|
66
66
|
example do
|
67
|
-
expect(provider.context).to receive(:shell).with(
|
68
|
-
'./deis git:remote --app=example'
|
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
67
|
expect(provider.context).to receive(:shell).with(
|
78
68
|
/grep -c 'PTY allocation request failed'/
|
79
69
|
).and_return(false)
|
@@ -98,7 +88,7 @@ describe DPL::Provider::Deis do
|
|
98
88
|
describe "#push_app" do
|
99
89
|
example do
|
100
90
|
expect(provider.context).to receive(:shell).with(
|
101
|
-
"bash -c 'git push deis HEAD:refs/heads/master -f 2>&1 | tr -dc \"[:alnum:][:space:][:punct:]\" | sed -E \"s/remote: (\\[1G)+//\" | sed \"s/\\[K$//\"; exit ${PIPESTATUS[0]}'"
|
91
|
+
"bash -c 'git push ssh://git@deis-builder.deisapps.com:2222/example.git HEAD:refs/heads/master -f 2>&1 | tr -dc \"[:alnum:][:space:][:punct:]\" | sed -E \"s/remote: (\\[1G)+//\" | sed \"s/\\[K$//\"; exit ${PIPESTATUS[0]}'"
|
102
92
|
).and_return(true)
|
103
93
|
provider.push_app
|
104
94
|
end
|
@@ -107,7 +97,7 @@ describe DPL::Provider::Deis do
|
|
107
97
|
describe "#run" do
|
108
98
|
example do
|
109
99
|
expect(provider.context).to receive(:shell).with(
|
110
|
-
'./deis run -- shell command'
|
100
|
+
'./deis run -a example -- shell command'
|
111
101
|
).and_return(true)
|
112
102
|
provider.run('shell command')
|
113
103
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dpl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.8.26.travis.
|
4
|
+
version: 1.8.26.travis.1775.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Konstantin Haase
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|