dpl 1.6.0.travis.399.1 → 1.6.0
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 +5 -13
- data/README.md +28 -1
- data/dpl.gemspec +5 -1
- data/lib/dpl/provider.rb +6 -0
- data/lib/dpl/provider/cloudcontrol.rb +1 -1
- data/lib/dpl/provider/deis.rb +105 -0
- data/lib/dpl/provider/hackage.rb +29 -0
- data/lib/dpl/provider/heroku/git.rb +5 -2
- data/lib/dpl/provider/openshift.rb +6 -1
- data/lib/dpl/provider/releases.rb +13 -8
- data/lib/dpl/version.rb +1 -1
- data/spec/provider/cloudcontrol_spec.rb +1 -1
- data/spec/provider/deis_spec.rb +98 -0
- data/spec/provider/hackage_spec.rb +47 -0
- data/spec/provider/heroku_git_spec.rb +1 -1
- data/spec/provider/openshift_spec.rb +10 -1
- data/spec/provider/releases_spec.rb +23 -5
- data/spec/provider_spec.rb +14 -0
- metadata +45 -17
checksums.yaml
CHANGED
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
|
|
5
|
-
data.tar.gz: !binary |-
|
|
6
|
-
ODJhNDlhZDBjN2VlMjQ2YWU5ZTI4MDkyMGExMDBjYTYyZmMxMWYwMg==
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: fc3fa6df6dedd580fd1808fc3c3b64baf36c7e9c
|
|
4
|
+
data.tar.gz: 04fb25535682b4039371f42e3f6b465eb903add2
|
|
7
5
|
SHA512:
|
|
8
|
-
metadata.gz:
|
|
9
|
-
|
|
10
|
-
OTRjMDFhMjMyYmNiNzkxNGM1NmMxYjA1NDJlOTQ0ZmJmNTNiZjYxMDZlMzk5
|
|
11
|
-
NThhYTBmMzY4YzU4YWIzMmI4MGM4YzM2YzZhZGY2M2UzYmEyNTI=
|
|
12
|
-
data.tar.gz: !binary |-
|
|
13
|
-
Y2EzYWZhMTY0NmQ0ODZhZDY3MWQ5MDc4NzYwYjRhNzYyZDJlMzFiMTgzYmQx
|
|
14
|
-
MGVhODExMTNjMjc5NmZjYTk2Y2U1OWM5ZDUyMjNmYjhiOWRiYjkwODU2MTI5
|
|
15
|
-
MzE5NmE1NmM2YWJiODE4MTUzMWE1NjYyMzFmODBiYWM0YTRmODc=
|
|
6
|
+
metadata.gz: 19da9b27a700bc9ed6ca9979cdc565fc6847adbfb93989269dd10c31741d5e84b3b19b6a6b3b6ade086bb2e95abaa1ad79253db56151fe28556fab8aa2df7c8d
|
|
7
|
+
data.tar.gz: d0d5df84c41f3ae95614908b864c84cc40425e82bcb2af2668b441b6a1dd19a69c1356654194d5ccf7b58120937bd86e3b6a15c25d44767deb54ff8553b862ef
|
data/README.md
CHANGED
|
@@ -23,6 +23,8 @@ Dpl supports the following providers:
|
|
|
23
23
|
* [Modulus](#modulus)
|
|
24
24
|
* [Github Releases](#github-releases)
|
|
25
25
|
* [Ninefold](#ninefold)
|
|
26
|
+
* [Hackage](#hackage)
|
|
27
|
+
* [Deis](#deis)
|
|
26
28
|
|
|
27
29
|
## Installation:
|
|
28
30
|
|
|
@@ -154,7 +156,7 @@ As a rule of thumb, you should switch to the Git strategy if you run into issues
|
|
|
154
156
|
#### Examples:
|
|
155
157
|
|
|
156
158
|
dpl --provider=pypi --user=<username> --password=<password>
|
|
157
|
-
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'
|
|
158
160
|
|
|
159
161
|
### NPM:
|
|
160
162
|
|
|
@@ -271,6 +273,7 @@ As a rule of thumb, you should switch to the Git strategy if you run into issues
|
|
|
271
273
|
* **password**: GitHub Password. Not necessary if `api-key` is used.
|
|
272
274
|
* **repo**: GitHub Repo. Defaults to git repo's name.
|
|
273
275
|
* **file**: File to upload to GitHub Release.
|
|
276
|
+
* **release-number**: Overide automatic release detection, set a release manually.
|
|
274
277
|
|
|
275
278
|
#### GitHub Two Factor Authentication
|
|
276
279
|
|
|
@@ -300,3 +303,27 @@ For accounts using two factor authentication, you have to use an oauth token as
|
|
|
300
303
|
#### Examples:
|
|
301
304
|
|
|
302
305
|
dpl --provider=ninefold --auth_token=<auth_token> --app_id=<app_id>
|
|
306
|
+
|
|
307
|
+
### Hackage:
|
|
308
|
+
|
|
309
|
+
#### Options:
|
|
310
|
+
|
|
311
|
+
* **username**: Hackage username.
|
|
312
|
+
* **password**: Hackage password.
|
|
313
|
+
|
|
314
|
+
#### Examples:
|
|
315
|
+
|
|
316
|
+
dpl --provider=hackage --username=<username> --password=<password>
|
|
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/dpl.gemspec
CHANGED
|
@@ -22,5 +22,9 @@ Gem::Specification.new do |s|
|
|
|
22
22
|
s.add_development_dependency 'json'
|
|
23
23
|
|
|
24
24
|
# prereleases from Travis CI
|
|
25
|
-
|
|
25
|
+
if ENV['CI']
|
|
26
|
+
digits = s.version.to_s.split '.'
|
|
27
|
+
digits[-1] = digits[-1].to_s.succ
|
|
28
|
+
s.version = digits.join('.') + ".travis.#{ENV['TRAVIS_JOB_NUMBER']}"
|
|
29
|
+
end
|
|
26
30
|
end
|
data/lib/dpl/provider.rb
CHANGED
|
@@ -24,6 +24,8 @@ module DPL
|
|
|
24
24
|
autoload :Releases, 'dpl/provider/releases'
|
|
25
25
|
autoload :Cloud66, 'dpl/provider/cloud66'
|
|
26
26
|
autoload :Ninefold, 'dpl/provider/ninefold'
|
|
27
|
+
autoload :Hackage, 'dpl/provider/hackage'
|
|
28
|
+
autoload :Deis, 'dpl/provider/deis'
|
|
27
29
|
|
|
28
30
|
def self.new(context, options)
|
|
29
31
|
return super if self < Provider
|
|
@@ -58,6 +60,10 @@ module DPL
|
|
|
58
60
|
system(command)
|
|
59
61
|
end
|
|
60
62
|
|
|
63
|
+
def self.apt_get(name, command = name)
|
|
64
|
+
context.shell("sudo apt-get -qq install #{name}", retry: true) if `which #{command}`.chop.empty?
|
|
65
|
+
end
|
|
66
|
+
|
|
61
67
|
def self.pip(name, command = name)
|
|
62
68
|
context.shell("sudo pip install #{name}", retry: true) if `which #{command}`.chop.empty?
|
|
63
69
|
end
|
|
@@ -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,29 @@
|
|
|
1
|
+
module DPL
|
|
2
|
+
class Provider
|
|
3
|
+
class Hackage < Provider
|
|
4
|
+
apt_get 'cabal', 'cabal-install'
|
|
5
|
+
|
|
6
|
+
def check_auth
|
|
7
|
+
unless option(:username) and option(:password)
|
|
8
|
+
raise Error, "must supply username and password"
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def check_app
|
|
13
|
+
context.shell "cabal check" or raise Error, "cabal check failed"
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def needs_key?
|
|
17
|
+
false
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def push_app
|
|
21
|
+
context.shell "cabal sdist" or raise Error, "cabal sdist failed"
|
|
22
|
+
Dir.glob("dist/*.tar.gz") do |tar|
|
|
23
|
+
context.shell "cabal upload --username=#{option(:username)} --password=#{option(:password)} #{tar}"
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
@@ -19,9 +19,12 @@ module DPL
|
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
def check_app
|
|
22
|
+
log "checking for app '#{option(:app)}'"
|
|
22
23
|
info = api.get_app(option(:app)).body
|
|
23
24
|
options[:git] ||= info['git_url']
|
|
24
|
-
log "found app #{info['name']}"
|
|
25
|
+
log "found app '#{info['name']}'"
|
|
26
|
+
rescue ::Heroku::API::Errors::Forbidden => error
|
|
27
|
+
raise Error, "#{error.message} (does the app '#{option(:app)}' exist and does your account have access to it?)", error.backtrace
|
|
25
28
|
end
|
|
26
29
|
|
|
27
30
|
def setup_key(file)
|
|
@@ -56,4 +59,4 @@ module DPL
|
|
|
56
59
|
end
|
|
57
60
|
end
|
|
58
61
|
end
|
|
59
|
-
end
|
|
62
|
+
end
|
|
@@ -33,7 +33,12 @@ module DPL
|
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
def push_app
|
|
36
|
-
|
|
36
|
+
if app.deployment_branch
|
|
37
|
+
context.shell "rhc app configure #{app.name} --deployment-branch #{app.deployment_branch}"
|
|
38
|
+
context.shell "git push #{app.git_url} -f #{app.deployment_branch}"
|
|
39
|
+
else
|
|
40
|
+
context.shell "git push #{app.git_url} -f"
|
|
41
|
+
end
|
|
37
42
|
end
|
|
38
43
|
|
|
39
44
|
def restart
|
|
@@ -6,7 +6,7 @@ module DPL
|
|
|
6
6
|
requires 'octokit'
|
|
7
7
|
requires 'mime-types'
|
|
8
8
|
|
|
9
|
-
def get_tag
|
|
9
|
+
def get_tag
|
|
10
10
|
`git describe --tags --exact-match 2>/dev/null`.chomp
|
|
11
11
|
end
|
|
12
12
|
|
|
@@ -27,7 +27,7 @@ module DPL
|
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
def user
|
|
30
|
-
user ||= api.user
|
|
30
|
+
@user ||= api.user
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
def needs_key?
|
|
@@ -49,7 +49,7 @@ module DPL
|
|
|
49
49
|
unless api.scopes.include? 'public_repo' or api.scopes.include? 'repo'
|
|
50
50
|
raise Error, "Dpl does not have permission to upload assets. Make sure your token contains the repo or public_repo scope."
|
|
51
51
|
end
|
|
52
|
-
|
|
52
|
+
|
|
53
53
|
log "Logged in as #{user.name}"
|
|
54
54
|
end
|
|
55
55
|
|
|
@@ -57,10 +57,15 @@ module DPL
|
|
|
57
57
|
tag_matched = false
|
|
58
58
|
release_url = nil
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
if options[:release_number]
|
|
61
|
+
tag_matched = true
|
|
62
|
+
release_url = "https://api.github.com/repos/" + slug + "/releases/" + options[:release_number]
|
|
63
|
+
else
|
|
64
|
+
releases.each do |release|
|
|
65
|
+
if release.tag_name == get_tag
|
|
66
|
+
release_url = release.rels[:self].href
|
|
67
|
+
tag_matched = true
|
|
68
|
+
end
|
|
64
69
|
end
|
|
65
70
|
end
|
|
66
71
|
|
|
@@ -80,7 +85,7 @@ module DPL
|
|
|
80
85
|
if already_exists
|
|
81
86
|
log "#{filename} already exists, skipping."
|
|
82
87
|
else
|
|
83
|
-
api.upload_asset(release_url,
|
|
88
|
+
api.upload_asset(release_url, file, {:name => filename, :content_type => MIME::Types.type_for(file).first.to_s})
|
|
84
89
|
end
|
|
85
90
|
end
|
|
86
91
|
end
|
data/lib/dpl/version.rb
CHANGED
|
@@ -85,7 +85,7 @@ describe DPL::Provider::CloudControl do
|
|
|
85
85
|
it '#push_app shuld deploy the app' do
|
|
86
86
|
provider.instance_variable_set(:@repository, 'foo_repo.git')
|
|
87
87
|
context = double(:shell)
|
|
88
|
-
context.should receive(:shell).with("git push foo_repo.git HEAD:master
|
|
88
|
+
context.should receive(:shell).with("git push foo_repo.git HEAD:master -f")
|
|
89
89
|
provider.should receive(:context).and_return context
|
|
90
90
|
provider.should receive(:deploy_app)
|
|
91
91
|
|
|
@@ -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
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
require 'dpl/provider/hackage'
|
|
3
|
+
|
|
4
|
+
describe DPL::Provider::Hackage do
|
|
5
|
+
subject :provider do
|
|
6
|
+
described_class.new(DummyContext.new, :username => 'FooUser', :password => 'bar')
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
describe :check_auth do
|
|
10
|
+
it 'should require username' do
|
|
11
|
+
provider.options.update(:username => nil)
|
|
12
|
+
expect {
|
|
13
|
+
provider.check_auth
|
|
14
|
+
}.to raise_error(DPL::Error)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
it 'should require password' do
|
|
18
|
+
provider.options.update(:password => nil)
|
|
19
|
+
expect {
|
|
20
|
+
provider.check_auth
|
|
21
|
+
}.to raise_error(DPL::Error)
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
describe :check_app do
|
|
26
|
+
it 'calls cabal' do
|
|
27
|
+
provider.context.should_receive(:shell).with("cabal check").and_return(true)
|
|
28
|
+
provider.check_app
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
it 'fails when cabal complains' do
|
|
32
|
+
provider.context.should_receive(:shell).with("cabal check").and_return(false)
|
|
33
|
+
expect {
|
|
34
|
+
provider.check_app
|
|
35
|
+
}.to raise_error(DPL::Error)
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
describe :push_app do
|
|
40
|
+
example do
|
|
41
|
+
provider.context.should_receive(:shell).with("cabal sdist").and_return(true)
|
|
42
|
+
Dir.should_receive(:glob).and_yield('dist/package-0.1.2.3.tar.gz')
|
|
43
|
+
provider.context.should_receive(:shell).with("cabal upload --username=FooUser --password=bar dist/package-0.1.2.3.tar.gz")
|
|
44
|
+
provider.push_app
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
@@ -45,7 +45,7 @@ describe DPL::Provider::Heroku do
|
|
|
45
45
|
|
|
46
46
|
describe :check_app do
|
|
47
47
|
example do
|
|
48
|
-
provider.should_receive(:log).with(
|
|
48
|
+
provider.should_receive(:log).at_least(1).times.with(/example/)
|
|
49
49
|
provider.check_app
|
|
50
50
|
provider.options[:git].should be == "GIT URL"
|
|
51
51
|
end
|
|
@@ -65,10 +65,19 @@ describe DPL::Provider::Openshift do
|
|
|
65
65
|
end
|
|
66
66
|
|
|
67
67
|
describe :push_app do
|
|
68
|
-
example do
|
|
68
|
+
example "when app.deployment_branch is not set" do
|
|
69
|
+
provider.app.should_receive :deployment_branch
|
|
69
70
|
provider.context.should_receive(:shell).with("git push git://something -f")
|
|
70
71
|
provider.push_app
|
|
71
72
|
end
|
|
73
|
+
|
|
74
|
+
example "when app.deployment_branch is set" do
|
|
75
|
+
provider.app.stub(:deployment_branch) { "test-branch" }
|
|
76
|
+
|
|
77
|
+
provider.context.should_receive(:shell).with("rhc app configure example --deployment-branch test-branch")
|
|
78
|
+
provider.context.should_receive(:shell).with("git push git://something -f test-branch")
|
|
79
|
+
provider.push_app
|
|
80
|
+
end
|
|
72
81
|
end
|
|
73
82
|
|
|
74
83
|
describe :restart do
|
|
@@ -86,8 +86,8 @@ describe DPL::Provider::Releases do
|
|
|
86
86
|
provider.api.release.rels[:assets].stub(:get).and_return({:data => [""]})
|
|
87
87
|
provider.api.release.rels[:assets].get.stub(:data).and_return([])
|
|
88
88
|
|
|
89
|
-
provider.api.should_receive(:upload_asset).with(anything, "foo.bar",
|
|
90
|
-
provider.api.should_receive(:upload_asset).with(anything, "bar.foo",
|
|
89
|
+
provider.api.should_receive(:upload_asset).with(anything, "test/foo.bar", {:name=>"foo.bar", :content_type=>""})
|
|
90
|
+
provider.api.should_receive(:upload_asset).with(anything, "bar.foo", {:name=>"bar.foo", :content_type=>""})
|
|
91
91
|
|
|
92
92
|
provider.push_app
|
|
93
93
|
end
|
|
@@ -111,7 +111,7 @@ describe DPL::Provider::Releases do
|
|
|
111
111
|
provider.api.release.rels[:assets].stub(:get).and_return({:data => [""]})
|
|
112
112
|
provider.api.release.rels[:assets].get.stub(:data).and_return([double(:name => "foo.bar"), double(:name => "foo.foo")])
|
|
113
113
|
|
|
114
|
-
provider.api.should_receive(:upload_asset).with(anything, "bar.foo",
|
|
114
|
+
provider.api.should_receive(:upload_asset).with(anything, "bar.foo", {:name=>"bar.foo", :content_type=>""})
|
|
115
115
|
provider.should_receive(:log).with("foo.bar already exists, skipping.")
|
|
116
116
|
|
|
117
117
|
provider.push_app
|
|
@@ -139,8 +139,26 @@ describe DPL::Provider::Releases do
|
|
|
139
139
|
provider.api.release.rels[:assets].stub(:get).and_return({:data => nil})
|
|
140
140
|
provider.api.release.rels[:assets].get.stub(:data).and_return([])
|
|
141
141
|
|
|
142
|
-
provider.api.should_receive(:upload_asset).with(anything, "foo.bar",
|
|
143
|
-
provider.api.should_receive(:upload_asset).with(anything, "bar.foo",
|
|
142
|
+
provider.api.should_receive(:upload_asset).with(anything, "test/foo.bar", {:name=>"foo.bar", :content_type=>""})
|
|
143
|
+
provider.api.should_receive(:upload_asset).with(anything, "bar.foo", {:name=>"bar.foo", :content_type=>""})
|
|
144
|
+
|
|
145
|
+
provider.push_app
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
example "With Release Number" do
|
|
149
|
+
allow_message_expectations_on_nil
|
|
150
|
+
|
|
151
|
+
provider.options.update(:file => ["bar.foo"])
|
|
152
|
+
provider.options.update(:release_number => "1234")
|
|
153
|
+
|
|
154
|
+
provider.stub(:slug).and_return("foo/bar")
|
|
155
|
+
|
|
156
|
+
provider.api.stub(:release)
|
|
157
|
+
provider.api.release.stub(:rels).and_return({:assets => nil})
|
|
158
|
+
provider.api.release.rels[:assets].stub(:get).and_return({:data => nil})
|
|
159
|
+
provider.api.release.rels[:assets].get.stub(:data).and_return([])
|
|
160
|
+
|
|
161
|
+
provider.api.should_receive(:upload_asset).with("https://api.github.com/repos/foo/bar/releases/1234", "bar.foo", {:name=>"bar.foo", :content_type=>""})
|
|
144
162
|
|
|
145
163
|
provider.push_app
|
|
146
164
|
end
|
data/spec/provider_spec.rb
CHANGED
|
@@ -31,6 +31,20 @@ describe DPL::Provider do
|
|
|
31
31
|
end
|
|
32
32
|
end
|
|
33
33
|
|
|
34
|
+
describe :apt_get do
|
|
35
|
+
example "installed" do
|
|
36
|
+
example_provider.should_receive(:`).with("which foo").and_return("/bin/foo\n")
|
|
37
|
+
example_provider.should_not_receive(:system)
|
|
38
|
+
example_provider.apt_get("foo")
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
example "missing" do
|
|
42
|
+
example_provider.should_receive(:`).with("which foo").and_return("")
|
|
43
|
+
example_provider.context.should_receive(:shell).with("sudo apt-get -qq install foo", retry: true)
|
|
44
|
+
example_provider.apt_get("foo")
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
34
48
|
describe :pip do
|
|
35
49
|
example "installed" do
|
|
36
50
|
example_provider.should_receive(:`).with("which foo").and_return("/bin/foo\n")
|
metadata
CHANGED
|
@@ -1,69 +1,69 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dpl
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.6.0
|
|
4
|
+
version: 1.6.0
|
|
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
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
|
-
- -
|
|
17
|
+
- - ">="
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
19
|
version: '0'
|
|
20
20
|
type: :development
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
|
-
- -
|
|
24
|
+
- - ">="
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
26
|
version: '0'
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: rake
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
|
-
- -
|
|
31
|
+
- - ">="
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
33
|
version: '0'
|
|
34
34
|
type: :development
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
|
-
- -
|
|
38
|
+
- - ">="
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
40
|
version: '0'
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
42
|
name: simplecov
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
44
44
|
requirements:
|
|
45
|
-
- -
|
|
45
|
+
- - ">="
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
47
|
version: '0'
|
|
48
48
|
type: :development
|
|
49
49
|
prerelease: false
|
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
51
|
requirements:
|
|
52
|
-
- -
|
|
52
|
+
- - ">="
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
54
|
version: '0'
|
|
55
55
|
- !ruby/object:Gem::Dependency
|
|
56
56
|
name: json
|
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
|
58
58
|
requirements:
|
|
59
|
-
- -
|
|
59
|
+
- - ">="
|
|
60
60
|
- !ruby/object:Gem::Version
|
|
61
61
|
version: '0'
|
|
62
62
|
type: :development
|
|
63
63
|
prerelease: false
|
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
65
|
requirements:
|
|
66
|
-
- -
|
|
66
|
+
- - ">="
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
68
|
version: '0'
|
|
69
69
|
description: deploy tool abstraction for clients
|
|
@@ -73,9 +73,9 @@ executables:
|
|
|
73
73
|
extensions: []
|
|
74
74
|
extra_rdoc_files: []
|
|
75
75
|
files:
|
|
76
|
-
- .gitignore
|
|
77
|
-
- .rspec
|
|
78
|
-
- .travis.yml
|
|
76
|
+
- ".gitignore"
|
|
77
|
+
- ".rspec"
|
|
78
|
+
- ".travis.yml"
|
|
79
79
|
- Gemfile
|
|
80
80
|
- LICENSE
|
|
81
81
|
- README.md
|
|
@@ -90,9 +90,11 @@ 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
|
|
97
|
+
- lib/dpl/provider/hackage.rb
|
|
96
98
|
- lib/dpl/provider/heroku.rb
|
|
97
99
|
- lib/dpl/provider/heroku/anvil.rb
|
|
98
100
|
- lib/dpl/provider/heroku/git.rb
|
|
@@ -117,8 +119,10 @@ files:
|
|
|
117
119
|
- spec/provider/cloud_files_spec.rb
|
|
118
120
|
- spec/provider/cloudcontrol_spec.rb
|
|
119
121
|
- spec/provider/cloudfoundry_spec.rb
|
|
122
|
+
- spec/provider/deis_spec.rb
|
|
120
123
|
- spec/provider/divshot_spec.rb
|
|
121
124
|
- spec/provider/dotcloud_spec.rb
|
|
125
|
+
- spec/provider/hackage_spec.rb
|
|
122
126
|
- spec/provider/heroku_anvil_spec.rb
|
|
123
127
|
- spec/provider/heroku_git_deploy_key_spec.rb
|
|
124
128
|
- spec/provider/heroku_git_spec.rb
|
|
@@ -143,18 +147,42 @@ require_paths:
|
|
|
143
147
|
- lib
|
|
144
148
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
145
149
|
requirements:
|
|
146
|
-
- -
|
|
150
|
+
- - ">="
|
|
147
151
|
- !ruby/object:Gem::Version
|
|
148
152
|
version: 1.8.7
|
|
149
153
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
150
154
|
requirements:
|
|
151
|
-
- -
|
|
155
|
+
- - ">="
|
|
152
156
|
- !ruby/object:Gem::Version
|
|
153
|
-
version:
|
|
157
|
+
version: '0'
|
|
154
158
|
requirements: []
|
|
155
159
|
rubyforge_project:
|
|
156
160
|
rubygems_version: 2.2.2
|
|
157
161
|
signing_key:
|
|
158
162
|
specification_version: 4
|
|
159
163
|
summary: deploy tool
|
|
160
|
-
test_files:
|
|
164
|
+
test_files:
|
|
165
|
+
- spec/cli_spec.rb
|
|
166
|
+
- spec/provider/appfog_spec.rb
|
|
167
|
+
- spec/provider/cloud66_spec.rb
|
|
168
|
+
- spec/provider/cloud_files_spec.rb
|
|
169
|
+
- spec/provider/cloudcontrol_spec.rb
|
|
170
|
+
- spec/provider/cloudfoundry_spec.rb
|
|
171
|
+
- spec/provider/deis_spec.rb
|
|
172
|
+
- spec/provider/divshot_spec.rb
|
|
173
|
+
- spec/provider/dotcloud_spec.rb
|
|
174
|
+
- spec/provider/hackage_spec.rb
|
|
175
|
+
- spec/provider/heroku_anvil_spec.rb
|
|
176
|
+
- spec/provider/heroku_git_deploy_key_spec.rb
|
|
177
|
+
- spec/provider/heroku_git_spec.rb
|
|
178
|
+
- spec/provider/modulus_spec.rb
|
|
179
|
+
- spec/provider/ninefold_spec.rb
|
|
180
|
+
- spec/provider/npm.rb
|
|
181
|
+
- spec/provider/openshift_spec.rb
|
|
182
|
+
- spec/provider/ops_works_spec.rb
|
|
183
|
+
- spec/provider/pypi_spec.rb
|
|
184
|
+
- spec/provider/releases_spec.rb
|
|
185
|
+
- spec/provider/rubygems_spec.rb
|
|
186
|
+
- spec/provider/s3_spec.rb
|
|
187
|
+
- spec/provider_spec.rb
|
|
188
|
+
- spec/spec_helper.rb
|