dpl-hackage 1.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/dpl-hackage.gemspec +3 -0
- data/lib/dpl/provider/hackage.rb +29 -0
- data/spec/provider/hackage_spec.rb +47 -0
- metadata +159 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 709c8ed339a536a0a4ac3e15fd44607dcb3799ea
|
4
|
+
data.tar.gz: 7c44e7123d4c4bb1f6c63097efa62a6c7f6b256f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 52cc6a05ab8d4c45a97927764cbea19d39f8b51aadd2563cffcd2a80e5e4429a6514af055dd52f77bb705e504220be148342de9555e3aa8810a322b1d400ab4b
|
7
|
+
data.tar.gz: beab63c1d806f832d05b22c3b9eaae2b71b8be9474c2b084c52b7ef9549bbce50c2ca5409332f1ed7c004690be4b799c80eaba7ee4f2e8faa0e1680096a5af51
|
data/dpl-hackage.gemspec
ADDED
@@ -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
|
+
|
@@ -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
|
+
expect(provider.context).to receive(:shell).with("cabal check").and_return(true)
|
28
|
+
provider.check_app
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'fails when cabal complains' do
|
32
|
+
expect(provider.context).to 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
|
+
expect(provider.context).to receive(:shell).with("cabal sdist").and_return(true)
|
42
|
+
expect(Dir).to receive(:glob).and_yield('dist/package-0.1.2.3.tar.gz')
|
43
|
+
expect(provider.context).to 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
|
metadata
ADDED
@@ -0,0 +1,159 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: dpl-hackage
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.9.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Konstantin Haase
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-03-08 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: dpl
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.9.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.9.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rspec
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec-its
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: json_pure
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: tins
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: coveralls
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: highline
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
description: deploy tool abstraction for clients
|
126
|
+
email: konstantin.mailinglists@googlemail.com
|
127
|
+
executables: []
|
128
|
+
extensions: []
|
129
|
+
extra_rdoc_files: []
|
130
|
+
files:
|
131
|
+
- dpl-hackage.gemspec
|
132
|
+
- lib/dpl/provider/hackage.rb
|
133
|
+
- spec/provider/hackage_spec.rb
|
134
|
+
homepage: https://github.com/travis-ci/dpl
|
135
|
+
licenses:
|
136
|
+
- MIT
|
137
|
+
metadata: {}
|
138
|
+
post_install_message:
|
139
|
+
rdoc_options: []
|
140
|
+
require_paths:
|
141
|
+
- lib
|
142
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
143
|
+
requirements:
|
144
|
+
- - ">="
|
145
|
+
- !ruby/object:Gem::Version
|
146
|
+
version: '2.2'
|
147
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
148
|
+
requirements:
|
149
|
+
- - ">="
|
150
|
+
- !ruby/object:Gem::Version
|
151
|
+
version: '0'
|
152
|
+
requirements: []
|
153
|
+
rubyforge_project:
|
154
|
+
rubygems_version: 2.6.13
|
155
|
+
signing_key:
|
156
|
+
specification_version: 4
|
157
|
+
summary: deploy tool
|
158
|
+
test_files:
|
159
|
+
- spec/provider/hackage_spec.rb
|