dpl 1.5.11.travis.437.1 → 1.5.11.travis.445.1
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 +8 -8
- data/README.md +14 -1
- data/lib/dpl/provider.rb +1 -0
- data/lib/dpl/provider/deis.rb +105 -0
- data/spec/provider/deis_spec.rb +98 -0
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
!binary "U0hBMQ==":
|
|
3
3
|
metadata.gz: !binary |-
|
|
4
|
-
|
|
4
|
+
NDg1NzRiZTRmOTZmNmUyOTMzMjQ1ZjI3OTRiYjM3NmU2NTkzMmU5OQ==
|
|
5
5
|
data.tar.gz: !binary |-
|
|
6
|
-
|
|
6
|
+
ZTFkYTA4OGU4YzUzMjkwMzliY2EyNWU4YmYzZWQ4YzdmYjZlZDZlMA==
|
|
7
7
|
SHA512:
|
|
8
8
|
metadata.gz: !binary |-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
Njg5Y2NmMGRjNmE5NjFkNzY1OWQxNmY1MzVkNWRkNmI4MTQ4OGMwOGY0ZTY3
|
|
10
|
+
YTJiYjYxZTcyNjNjYTJkMmIxNTNjOTYxYTM1YzA2ZTcyNGYxMzIzNmNlOTIz
|
|
11
|
+
N2E1NmVmNDAyNmIxNjNiOWVkM2Q3MWJmNWQyYzA5NzFmOTU3NWE=
|
|
12
12
|
data.tar.gz: !binary |-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
Y2UxMzM2ZWJiYjAzNTM5NjFkMjJiYzE4NmE1ZTgxMTljYTc3ZjMzZGVmNGVi
|
|
14
|
+
NDg0MjgwMjhkN2ZkYmZiYTdhOTEyMjdiZjU1ZDk2Y2EyYjM3ZTI0MGNlZjk3
|
|
15
|
+
NzY2MjllMzllNDgxZDdhN2Q1Y2FkMzhhMGYyMDY4YTgyOWJlZDM=
|
data/README.md
CHANGED
|
@@ -24,6 +24,7 @@ Dpl supports the following providers:
|
|
|
24
24
|
* [Github Releases](#github-releases)
|
|
25
25
|
* [Ninefold](#ninefold)
|
|
26
26
|
* [Hackage](#hackage)
|
|
27
|
+
* [Deis](#deis)
|
|
27
28
|
|
|
28
29
|
## Installation:
|
|
29
30
|
|
|
@@ -155,7 +156,7 @@ As a rule of thumb, you should switch to the Git strategy if you run into issues
|
|
|
155
156
|
#### Examples:
|
|
156
157
|
|
|
157
158
|
dpl --provider=pypi --user=<username> --password=<password>
|
|
158
|
-
dpl --provider=pypi --user=<username> --password=<password> --server=`https://mypackageindex.com/index` --distributions='sdist
|
|
159
|
+
dpl --provider=pypi --user=<username> --password=<password> --server=`https://mypackageindex.com/index` --distributions='sdist bdist_wheel'
|
|
159
160
|
|
|
160
161
|
### NPM:
|
|
161
162
|
|
|
@@ -314,3 +315,15 @@ For accounts using two factor authentication, you have to use an oauth token as
|
|
|
314
315
|
|
|
315
316
|
dpl --provider=hackage --username=<username> --password=<password>
|
|
316
317
|
|
|
318
|
+
### Deis:
|
|
319
|
+
|
|
320
|
+
#### Options:
|
|
321
|
+
|
|
322
|
+
* **controller**: Deis controller e.g. deis.deisapps.com
|
|
323
|
+
* **username**: Deis username
|
|
324
|
+
* **password**: Deis password
|
|
325
|
+
* **app**: Deis app
|
|
326
|
+
|
|
327
|
+
#### Examples:
|
|
328
|
+
|
|
329
|
+
dpl --provider=deis --controller=deis.deisapps.com --username=travis --password=secret --app=example
|
data/lib/dpl/provider.rb
CHANGED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
module DPL
|
|
2
|
+
class Provider
|
|
3
|
+
class Deis < Provider
|
|
4
|
+
experimental 'Deis'
|
|
5
|
+
pip 'deis', 'deis'
|
|
6
|
+
|
|
7
|
+
def needs_key?
|
|
8
|
+
true
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def check_auth
|
|
12
|
+
unless context.shell "deis login #{controller_url}" \
|
|
13
|
+
" --username=#{option(:username)}" \
|
|
14
|
+
" --password=#{option(:password)}"
|
|
15
|
+
error 'Login failed.'
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def check_app
|
|
20
|
+
unless context.shell "deis apps:info --app=#{option(:app)}"
|
|
21
|
+
error 'Application could not be verified.'
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def setup_key(file)
|
|
26
|
+
unless context.shell "deis keys:add #{file}"
|
|
27
|
+
error 'Adding keys failed.'
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def setup_git_ssh(path, key_path)
|
|
32
|
+
super(path, key_path)
|
|
33
|
+
# Deis uses a non-standard port, so we need to create a
|
|
34
|
+
# ssh config shortcut
|
|
35
|
+
key_path = File.expand_path(key_path)
|
|
36
|
+
add_ssh_config_entry(key_path)
|
|
37
|
+
# A git remote is required for running commands
|
|
38
|
+
# https://github.com/deis/deis/issues/1086
|
|
39
|
+
add_git_remote
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def remove_key
|
|
43
|
+
unless context.shell "deis keys:remove #{option(:key_name)}"
|
|
44
|
+
error 'Removing keys failed.'
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def push_app
|
|
49
|
+
wait_until_key_is_set
|
|
50
|
+
unless context.shell "git push #{git_push_url} HEAD:refs/heads/master -f"
|
|
51
|
+
error 'Deploying application failed.'
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def run(command)
|
|
56
|
+
unless context.shell "deis apps:run #{command}"
|
|
57
|
+
error 'Running command failed.'
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
private
|
|
62
|
+
|
|
63
|
+
def wait_until_key_is_set
|
|
64
|
+
sleep 5
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
def ssh_config_entry(key_file)
|
|
68
|
+
"\nHost deis-repo\n" \
|
|
69
|
+
" Hostname #{option(:controller)}\n" \
|
|
70
|
+
" Port 2222\n" \
|
|
71
|
+
" User git\n" \
|
|
72
|
+
" IdentityFile #{key_file}\n"
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
def add_ssh_config_entry(key_file)
|
|
76
|
+
FileUtils.mkdir_p(ssh_config_dir)
|
|
77
|
+
File.open(ssh_config, 'a') { |f| f.write(ssh_config_entry(key_file)) }
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
def ssh_config
|
|
81
|
+
File.join(ssh_config_dir, 'config')
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
def ssh_config_dir
|
|
85
|
+
File.join(Dir.home, '.ssh')
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
def add_git_remote
|
|
89
|
+
context.shell "git remote add deis #{git_remote_url}"
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
def git_push_url
|
|
93
|
+
"deis-repo:#{option(:app)}.git"
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
def git_remote_url
|
|
97
|
+
"ssh://git@#{option(:controller)}:2222/#{option(:app)}.git"
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
def controller_url
|
|
101
|
+
"http://#{option(:controller)}"
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
end
|
|
105
|
+
end
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
require 'dpl/provider/deis'
|
|
3
|
+
|
|
4
|
+
describe DPL::Provider::Deis do
|
|
5
|
+
subject :provider do
|
|
6
|
+
described_class.new(DummyContext.new, :app => 'example',
|
|
7
|
+
:key_name => 'key',
|
|
8
|
+
:controller => 'deis.deisapps.com',
|
|
9
|
+
:username => 'travis',
|
|
10
|
+
:password => 'secret')
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
describe :needs_key? do
|
|
14
|
+
example do
|
|
15
|
+
expect(provider.needs_key?).to eq(true)
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
describe :check_auth do
|
|
20
|
+
example do
|
|
21
|
+
expect(provider.context).to receive(:shell).with(
|
|
22
|
+
'deis login http://deis.deisapps.com --username=travis --password=secret'
|
|
23
|
+
).and_return(true)
|
|
24
|
+
provider.check_auth
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
describe :check_app do
|
|
29
|
+
example do
|
|
30
|
+
expect(provider.context).to receive(:shell).with(
|
|
31
|
+
'deis apps:info --app=example'
|
|
32
|
+
).and_return(true)
|
|
33
|
+
provider.check_app
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
describe :setup_key do
|
|
38
|
+
let(:ssh_config_handle) { double 'ssh_config_handle' }
|
|
39
|
+
let(:ssh_config) { File.join(Dir.home, '.ssh', 'config') }
|
|
40
|
+
let(:identity_file) { File.join(Dir.pwd, 'key_file') }
|
|
41
|
+
example do
|
|
42
|
+
expect(provider.context).to receive(:shell).with(
|
|
43
|
+
'deis keys:add key_file'
|
|
44
|
+
).and_return(true)
|
|
45
|
+
provider.setup_key('key_file')
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
describe :setup_git_ssh do
|
|
50
|
+
let(:ssh_config_handle) { double 'ssh_config_handle' }
|
|
51
|
+
let(:ssh_config) { File.join(Dir.home, '.ssh', 'config') }
|
|
52
|
+
let(:identity_file) { File.join(Dir.pwd, 'key_file') }
|
|
53
|
+
let(:git_ssh) { File.join(Dir.pwd, 'foo') }
|
|
54
|
+
after { FileUtils.rm ENV.delete('GIT_SSH') }
|
|
55
|
+
|
|
56
|
+
example do
|
|
57
|
+
expect(File).to receive(:open).with(git_ssh, 'w').and_call_original
|
|
58
|
+
expect(File).to receive(:open).with(ssh_config, 'a')
|
|
59
|
+
.and_yield(ssh_config_handle)
|
|
60
|
+
|
|
61
|
+
expect(ssh_config_handle).to receive(:write).with(
|
|
62
|
+
"\nHost deis-repo\n Hostname deis.deisapps.com\n Port 2222\n" \
|
|
63
|
+
" User git\n IdentityFile #{identity_file}\n"
|
|
64
|
+
)
|
|
65
|
+
expect(provider.context).to receive(:shell).with(
|
|
66
|
+
'git remote add deis ssh://git@deis.deisapps.com:2222/example.git'
|
|
67
|
+
)
|
|
68
|
+
provider.setup_git_ssh('foo', 'key_file')
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
describe :remove_key do
|
|
73
|
+
example do
|
|
74
|
+
expect(provider.context).to receive(:shell).with(
|
|
75
|
+
'deis keys:remove key'
|
|
76
|
+
).and_return(true)
|
|
77
|
+
provider.remove_key
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
describe :push_app do
|
|
82
|
+
example do
|
|
83
|
+
expect(provider.context).to receive(:shell).with(
|
|
84
|
+
'git push deis-repo:example.git HEAD:refs/heads/master -f'
|
|
85
|
+
).and_return(true)
|
|
86
|
+
provider.push_app
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
describe :run do
|
|
91
|
+
example do
|
|
92
|
+
expect(provider.context).to receive(:shell).with(
|
|
93
|
+
'deis apps:run shell command'
|
|
94
|
+
).and_return(true)
|
|
95
|
+
provider.run('shell command')
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
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.5.11.travis.
|
|
4
|
+
version: 1.5.11.travis.445.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Konstantin Haase
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-
|
|
11
|
+
date: 2014-06-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rspec
|
|
@@ -90,6 +90,7 @@ files:
|
|
|
90
90
|
- lib/dpl/provider/cloud_files.rb
|
|
91
91
|
- lib/dpl/provider/cloud_foundry.rb
|
|
92
92
|
- lib/dpl/provider/cloudcontrol.rb
|
|
93
|
+
- lib/dpl/provider/deis.rb
|
|
93
94
|
- lib/dpl/provider/divshot.rb
|
|
94
95
|
- lib/dpl/provider/dot_cloud.rb
|
|
95
96
|
- lib/dpl/provider/engine_yard.rb
|
|
@@ -118,6 +119,7 @@ files:
|
|
|
118
119
|
- spec/provider/cloud_files_spec.rb
|
|
119
120
|
- spec/provider/cloudcontrol_spec.rb
|
|
120
121
|
- spec/provider/cloudfoundry_spec.rb
|
|
122
|
+
- spec/provider/deis_spec.rb
|
|
121
123
|
- spec/provider/divshot_spec.rb
|
|
122
124
|
- spec/provider/dotcloud_spec.rb
|
|
123
125
|
- spec/provider/hackage_spec.rb
|