brightbox-cli 2.8.1 → 2.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +1 -0
- data/CHANGELOG.md +15 -0
- data/Gemfile.lock +7 -6
- data/Jenkinsfile +93 -0
- data/README.rdoc +1 -1
- data/brightbox-cli.gemspec +1 -1
- data/lib/brightbox-cli/images.rb +1 -1
- data/lib/brightbox-cli/version.rb +1 -1
- data/spec/commands/images/list_spec.rb +141 -2
- data/spec/spec_helper.rb +1 -0
- metadata +10 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 0913b64952b1c93b6e8da4fae57444fbdbef214418c6ca5da82b48e25b2b2ed6
|
4
|
+
data.tar.gz: efae4032ec4db36e6cf618f4271e09718322dfbac24a85c3f84496e23661268a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0df5e69cc133fc086a8a69bee79b38fd7337228e54be5bbc8729e1b08c1f152562b749dfb98128403802e7e7941e07ddea6ea7de3955478508fa26a69c8f8f6d
|
7
|
+
data.tar.gz: c968eef839066afce0ab0626bbed1ac750164dfa07eafeb87177f9249314de1d178962ad9e3e976ca3b9445ade3801db86a8c3cee3ead4c70769bbe6fe56045b
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,18 @@
|
|
1
|
+
### v2.8.2 /2018-08-21
|
2
|
+
|
3
|
+
[Full Changelog](https://github.com/brightbox/brightbox-cli/compare/v2.8.1...v2.8.2)
|
4
|
+
|
5
|
+
Bug fixes:
|
6
|
+
|
7
|
+
* Fix image list filter when using `--account/-l` options caused by hash key
|
8
|
+
type change somewhere in the stack.
|
9
|
+
|
10
|
+
Changes:
|
11
|
+
|
12
|
+
* Update `fog-brightbox` to v0.15.0
|
13
|
+
* Limit `fog-brightbox` dependency to < 1.0 to avoid issue following major update
|
14
|
+
* Add Jenkinsfile for internal CI
|
15
|
+
|
1
16
|
### v2.8.1 / 2018-04-10
|
2
17
|
|
3
18
|
[Full Changelog](https://github.com/brightbox/brightbox-cli/compare/v2.8.0...v2.8.1)
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
brightbox-cli (2.8.
|
5
|
-
fog-brightbox (>= 0.14.0)
|
4
|
+
brightbox-cli (2.8.2)
|
5
|
+
fog-brightbox (>= 0.14.0, < 1.0)
|
6
6
|
gli (~> 2.12.0)
|
7
7
|
highline (~> 1.6.0)
|
8
8
|
hirb (~> 0.6)
|
@@ -20,16 +20,17 @@ GEM
|
|
20
20
|
safe_yaml (~> 1.0.0)
|
21
21
|
diff-lcs (1.2.5)
|
22
22
|
excon (0.62.0)
|
23
|
-
fog-brightbox (0.
|
23
|
+
fog-brightbox (0.15.0)
|
24
24
|
fog-core (~> 1.22)
|
25
25
|
fog-json
|
26
26
|
inflecto (~> 0.0.2)
|
27
|
+
mime-types
|
27
28
|
fog-core (1.45.0)
|
28
29
|
builder
|
29
30
|
excon (~> 0.58)
|
30
31
|
formatador (~> 0.2)
|
31
|
-
fog-json (1.0
|
32
|
-
fog-core
|
32
|
+
fog-json (1.2.0)
|
33
|
+
fog-core
|
33
34
|
multi_json (~> 1.10)
|
34
35
|
formatador (0.2.5)
|
35
36
|
gli (2.12.3)
|
@@ -79,4 +80,4 @@ DEPENDENCIES
|
|
79
80
|
webmock
|
80
81
|
|
81
82
|
BUNDLED WITH
|
82
|
-
1.16.
|
83
|
+
1.16.2
|
data/Jenkinsfile
ADDED
@@ -0,0 +1,93 @@
|
|
1
|
+
pipeline {
|
2
|
+
agent none
|
3
|
+
options {
|
4
|
+
ansiColor('xterm')
|
5
|
+
}
|
6
|
+
triggers {
|
7
|
+
cron('@monthly')
|
8
|
+
}
|
9
|
+
stages {
|
10
|
+
stage("Run tests") {
|
11
|
+
parallel {
|
12
|
+
stage("Ruby 1.9.3") {
|
13
|
+
agent {
|
14
|
+
docker {
|
15
|
+
image 'ruby:1.9.3'
|
16
|
+
}
|
17
|
+
}
|
18
|
+
steps {
|
19
|
+
sh 'BUNDLE_APP_CONFIG=/tmp/bundle.config BUNDLE_DISABLE_SHARED_GEMS=true bundle install --deployment'
|
20
|
+
sh 'BUNDLE_APP_CONFIG=/tmp/bundle.config bundle exec rake test'
|
21
|
+
}
|
22
|
+
}
|
23
|
+
stage("Ruby 2.0") {
|
24
|
+
agent {
|
25
|
+
docker {
|
26
|
+
image 'ruby:2.0'
|
27
|
+
}
|
28
|
+
}
|
29
|
+
steps {
|
30
|
+
sh 'bundle install --deployment'
|
31
|
+
sh 'bundle exec rake test'
|
32
|
+
}
|
33
|
+
}
|
34
|
+
stage("Ruby 2.1") {
|
35
|
+
agent {
|
36
|
+
docker {
|
37
|
+
image 'ruby:2.1'
|
38
|
+
}
|
39
|
+
}
|
40
|
+
steps {
|
41
|
+
sh 'bundle install --deployment'
|
42
|
+
sh 'bundle exec rake test'
|
43
|
+
}
|
44
|
+
}
|
45
|
+
stage("Ruby 2.2") {
|
46
|
+
agent {
|
47
|
+
docker {
|
48
|
+
image 'ruby:2.2'
|
49
|
+
}
|
50
|
+
}
|
51
|
+
steps {
|
52
|
+
sh 'bundle install --deployment'
|
53
|
+
sh 'bundle exec rake test'
|
54
|
+
}
|
55
|
+
}
|
56
|
+
stage("Ruby 2.3") {
|
57
|
+
agent {
|
58
|
+
docker {
|
59
|
+
image 'ruby:2.3'
|
60
|
+
}
|
61
|
+
}
|
62
|
+
steps {
|
63
|
+
sh 'bundle install --deployment'
|
64
|
+
sh 'bundle exec rake test'
|
65
|
+
}
|
66
|
+
}
|
67
|
+
stage("Ruby 2.4") {
|
68
|
+
agent {
|
69
|
+
docker {
|
70
|
+
image 'ruby:2.4'
|
71
|
+
}
|
72
|
+
}
|
73
|
+
steps {
|
74
|
+
sh 'bundle install --deployment'
|
75
|
+
sh 'bundle exec rake test'
|
76
|
+
}
|
77
|
+
}
|
78
|
+
stage("Ruby 2.5") {
|
79
|
+
agent {
|
80
|
+
docker {
|
81
|
+
image 'ruby:2.5'
|
82
|
+
}
|
83
|
+
}
|
84
|
+
steps {
|
85
|
+
sh 'bundle install --deployment'
|
86
|
+
sh 'bundle exec rake test'
|
87
|
+
}
|
88
|
+
}
|
89
|
+
|
90
|
+
}
|
91
|
+
}
|
92
|
+
}
|
93
|
+
}
|
data/README.rdoc
CHANGED
@@ -1 +1 @@
|
|
1
|
-
README
|
1
|
+
./README
|
data/brightbox-cli.gemspec
CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
|
|
21
21
|
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
22
22
|
s.require_paths = ["lib"]
|
23
23
|
|
24
|
-
s.add_dependency "fog-brightbox", ">= 0.14.0"
|
24
|
+
s.add_dependency "fog-brightbox", ">= 0.14.0", "< 1.0"
|
25
25
|
s.add_dependency "gli", "~> 2.12.0"
|
26
26
|
s.add_dependency "i18n", "~> 0.6.0"
|
27
27
|
s.add_dependency "mime-types", "~> 2.6"
|
data/lib/brightbox-cli/images.rb
CHANGED
@@ -41,7 +41,7 @@ module Brightbox
|
|
41
41
|
|
42
42
|
unless options[:a]
|
43
43
|
account = Account.conn.get_scoped_account(:nested => false)
|
44
|
-
images.reject! { |i| !i.official && i.owner_id != account[
|
44
|
+
images.reject! { |i| !i.official && i.owner_id != account["id"] }
|
45
45
|
end
|
46
46
|
|
47
47
|
snapshots = images.select { |i| i.source_type == 'snapshot' }
|
@@ -7,11 +7,150 @@ describe "brightbox images" do
|
|
7
7
|
let(:stdout) { output.stdout }
|
8
8
|
let(:stderr) { output.stderr }
|
9
9
|
|
10
|
-
|
10
|
+
before do
|
11
|
+
config_from_contents(USER_APP_CONFIG_CONTENTS)
|
12
|
+
|
13
|
+
stub_request(:post, "http://api.brightbox.dev/token").
|
14
|
+
to_return(status: 200, body: JSON.dump(access_token: "ACCESS-TOKEN", refresh_token: "REFRESH-TOKEN"))
|
15
|
+
|
16
|
+
image_listing_json = JSON.dump([
|
17
|
+
{
|
18
|
+
id: "img-test1",
|
19
|
+
name: "Official image",
|
20
|
+
status: "available",
|
21
|
+
official: true,
|
22
|
+
public: true,
|
23
|
+
source_type: "upload",
|
24
|
+
owner: "acc-99999"
|
25
|
+
},
|
26
|
+
{
|
27
|
+
id: "img-test2",
|
28
|
+
name: "Public image",
|
29
|
+
status: "available",
|
30
|
+
official: false,
|
31
|
+
public: true,
|
32
|
+
source_type: "upload",
|
33
|
+
owner: "acc-abcde"
|
34
|
+
},
|
35
|
+
{
|
36
|
+
id: "img-test3",
|
37
|
+
name: "Customer image",
|
38
|
+
status: "available",
|
39
|
+
official: false,
|
40
|
+
public: false,
|
41
|
+
source_type: "upload",
|
42
|
+
owner: "acc-12345"
|
43
|
+
},
|
44
|
+
{
|
45
|
+
id: "img-test4",
|
46
|
+
name: "Customer snapshot",
|
47
|
+
status: "available",
|
48
|
+
official: false,
|
49
|
+
public: false,
|
50
|
+
source_type: "snapshot",
|
51
|
+
owner: "acc-12345"
|
52
|
+
},
|
53
|
+
{
|
54
|
+
id: "img-test5",
|
55
|
+
name: "Customer deleting image",
|
56
|
+
status: "deleting",
|
57
|
+
official: false,
|
58
|
+
public: false,
|
59
|
+
source_type: "upload",
|
60
|
+
owner: "acc-12345"
|
61
|
+
}
|
62
|
+
])
|
63
|
+
|
64
|
+
stub_request(:get, "http://api.brightbox.dev/1.0/images?account_id=acc-12345").
|
65
|
+
with(headers: { "Authorization" => "Bearer ACCESS-TOKEN" }).
|
66
|
+
to_return(status: 200, body: image_listing_json)
|
67
|
+
|
68
|
+
stub_request(:get, "http://api.brightbox.dev/1.0/account?account_id=acc-12345&nested=false").
|
69
|
+
with(headers: { "Authorization" => "Bearer ACCESS-TOKEN" }).
|
70
|
+
to_return(status: 200, body: JSON.dump({ id: "acc-12345" }))
|
71
|
+
end
|
72
|
+
|
73
|
+
context "when default listing" do
|
11
74
|
let(:argv) { %w(images list) }
|
12
75
|
|
13
76
|
it "does not error" do
|
14
|
-
expect
|
77
|
+
expect(stderr).not_to include("ERROR")
|
78
|
+
|
79
|
+
expect(stdout).to include("img-test1")
|
80
|
+
expect(stdout).not_to include("img-test2")
|
81
|
+
expect(stdout).to include("img-test3")
|
82
|
+
expect(stdout).to include("img-test4")
|
83
|
+
expect(stdout).to include("img-test5")
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
context "when listing all cases" do
|
88
|
+
let(:argv) { %w(images list --show-all) }
|
89
|
+
|
90
|
+
it "does not error" do
|
91
|
+
expect(stderr).not_to include("ERROR")
|
92
|
+
|
93
|
+
expect(stdout).to include("img-test1")
|
94
|
+
expect(stdout).to include("img-test2")
|
95
|
+
expect(stdout).to include("img-test3")
|
96
|
+
expect(stdout).to include("img-test4")
|
97
|
+
expect(stdout).to include("img-test5")
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
context "when filtering by status" do
|
102
|
+
let(:argv) { %w(images list --status deleting) }
|
103
|
+
|
104
|
+
it "does not error" do
|
105
|
+
expect(stderr).not_to include("ERROR")
|
106
|
+
|
107
|
+
expect(stdout).not_to include("img-test1")
|
108
|
+
expect(stdout).not_to include("img-test2")
|
109
|
+
expect(stdout).not_to include("img-test3")
|
110
|
+
expect(stdout).not_to include("img-test4")
|
111
|
+
expect(stdout).to include("img-test5")
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
context "when filtering by type" do
|
116
|
+
let(:argv) { %w(images list --type snapshot) }
|
117
|
+
|
118
|
+
it "does not error" do
|
119
|
+
expect(stderr).not_to include("ERROR")
|
120
|
+
|
121
|
+
expect(stdout).not_to include("img-test1")
|
122
|
+
expect(stdout).not_to include("img-test2")
|
123
|
+
expect(stdout).not_to include("img-test3")
|
124
|
+
expect(stdout).to include("img-test4")
|
125
|
+
expect(stdout).not_to include("img-test5")
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
context "when filtering by own account ID" do
|
130
|
+
let(:argv) { %w(images list --account acc-12345) }
|
131
|
+
|
132
|
+
it "does not error" do
|
133
|
+
expect(stderr).not_to include("ERROR")
|
134
|
+
|
135
|
+
expect(stdout).not_to include("img-test1")
|
136
|
+
expect(stdout).not_to include("img-test2")
|
137
|
+
expect(stdout).to include("img-test3")
|
138
|
+
expect(stdout).to include("img-test4")
|
139
|
+
expect(stdout).to include("img-test5")
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
context "when filter by own account ID and all" do
|
144
|
+
let(:argv) { %w(images list --account acc-12345 --show-all) }
|
145
|
+
|
146
|
+
it "does not error" do
|
147
|
+
expect(stderr).not_to include("ERROR")
|
148
|
+
|
149
|
+
expect(stdout).not_to include("img-test1")
|
150
|
+
expect(stdout).not_to include("img-test2")
|
151
|
+
expect(stdout).to include("img-test3")
|
152
|
+
expect(stdout).to include("img-test4")
|
153
|
+
expect(stdout).to include("img-test5")
|
15
154
|
end
|
16
155
|
end
|
17
156
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: brightbox-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.8.
|
4
|
+
version: 2.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Leach
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-08-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fog-brightbox
|
@@ -17,6 +17,9 @@ dependencies:
|
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 0.14.0
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '1.0'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -24,6 +27,9 @@ dependencies:
|
|
24
27
|
- - ">="
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: 0.14.0
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '1.0'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: gli
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -218,6 +224,7 @@ files:
|
|
218
224
|
- CHANGELOG.md
|
219
225
|
- Gemfile
|
220
226
|
- Gemfile.lock
|
227
|
+
- Jenkinsfile
|
221
228
|
- LICENSE
|
222
229
|
- README
|
223
230
|
- README.rdoc
|
@@ -732,7 +739,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
732
739
|
version: '0'
|
733
740
|
requirements: []
|
734
741
|
rubyforge_project: brightbox-cli
|
735
|
-
rubygems_version: 2.6
|
742
|
+
rubygems_version: 2.7.6
|
736
743
|
signing_key:
|
737
744
|
specification_version: 4
|
738
745
|
summary: The Brightbox cloud management system
|