brightbox-cli 3.0.0 → 3.0.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 +4 -4
- data/CHANGELOG.md +8 -0
- data/Gemfile.lock +1 -1
- data/Jenkinsfile +7 -7
- data/lib/brightbox-cli/cloud_ips.rb +1 -1
- data/lib/brightbox-cli/version.rb +1 -1
- data/spec/commands/cloudips/update_spec.rb +65 -0
- data/spec/commands/sql/instances/create_spec.rb +26 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1cc8d372e2c0c019461ab6f5302f71d9a5241646d57cc91eaba2be3033794012
|
4
|
+
data.tar.gz: 95314299e02e4d28ea02467a00eb5093f7e74c9dbc561459ea892175edc08043
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e32fdba2d13ad2917a7200f5cba06223ec2fcf059dc3404685b790f81b64c009857e7f984e9c9a7e01f06d55db31f00820413c77ff1570ed5a934c78cc9c03a2
|
7
|
+
data.tar.gz: 1d7c5414f09b8b1ffba4a3a00792dacb5555b0b2da38da9044591d8ab6ddbcc36dcb7a35e700ad61a839f414f26f9b7d5fe04210221438e82b864eb5a607a3cc
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
### v3.0.1 / 2020-07-01
|
2
|
+
|
3
|
+
[Full Changelog](https://github.com/brightbox/brightbox-cli/compare/v3.0.0...v3.0.1)
|
4
|
+
|
5
|
+
Bug fixes:
|
6
|
+
|
7
|
+
* Fix `cloudips update --name` to correctly set blank names
|
8
|
+
|
1
9
|
### v3.0.0 / 2020-07-01
|
2
10
|
|
3
11
|
[Full Changelog](https://github.com/brightbox/brightbox-cli/compare/v2.12.0...v3.0.0)
|
data/Gemfile.lock
CHANGED
data/Jenkinsfile
CHANGED
@@ -17,7 +17,7 @@ pipeline {
|
|
17
17
|
}
|
18
18
|
steps {
|
19
19
|
sh 'bundle install --deployment'
|
20
|
-
sh 'bundle exec rake
|
20
|
+
sh 'bundle exec rake spec'
|
21
21
|
}
|
22
22
|
}
|
23
23
|
stage("Ruby 2.1") {
|
@@ -28,7 +28,7 @@ pipeline {
|
|
28
28
|
}
|
29
29
|
steps {
|
30
30
|
sh 'bundle install --deployment'
|
31
|
-
sh 'bundle exec rake
|
31
|
+
sh 'bundle exec rake spec'
|
32
32
|
}
|
33
33
|
}
|
34
34
|
stage("Ruby 2.2") {
|
@@ -39,7 +39,7 @@ pipeline {
|
|
39
39
|
}
|
40
40
|
steps {
|
41
41
|
sh 'bundle install --deployment'
|
42
|
-
sh 'bundle exec rake
|
42
|
+
sh 'bundle exec rake spec'
|
43
43
|
}
|
44
44
|
}
|
45
45
|
stage("Ruby 2.3") {
|
@@ -50,7 +50,7 @@ pipeline {
|
|
50
50
|
}
|
51
51
|
steps {
|
52
52
|
sh 'bundle install --deployment'
|
53
|
-
sh 'bundle exec rake
|
53
|
+
sh 'bundle exec rake spec'
|
54
54
|
}
|
55
55
|
}
|
56
56
|
stage("Ruby 2.4") {
|
@@ -61,7 +61,7 @@ pipeline {
|
|
61
61
|
}
|
62
62
|
steps {
|
63
63
|
sh 'bundle install --deployment'
|
64
|
-
sh 'bundle exec rake
|
64
|
+
sh 'bundle exec rake spec'
|
65
65
|
}
|
66
66
|
}
|
67
67
|
stage("Ruby 2.5") {
|
@@ -72,7 +72,7 @@ pipeline {
|
|
72
72
|
}
|
73
73
|
steps {
|
74
74
|
sh 'bundle install --deployment'
|
75
|
-
sh 'bundle exec rake
|
75
|
+
sh 'bundle exec rake spec'
|
76
76
|
}
|
77
77
|
}
|
78
78
|
stage("Ruby 2.6") {
|
@@ -83,7 +83,7 @@ pipeline {
|
|
83
83
|
}
|
84
84
|
steps {
|
85
85
|
sh 'bundle install --deployment'
|
86
|
-
sh 'bundle exec rake
|
86
|
+
sh 'bundle exec rake spec'
|
87
87
|
}
|
88
88
|
}
|
89
89
|
}
|
@@ -7,6 +7,13 @@ describe "brightbox cloudips" do
|
|
7
7
|
let(:stdout) { output.stdout }
|
8
8
|
let(:stderr) { output.stderr }
|
9
9
|
|
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
|
+
end
|
16
|
+
|
10
17
|
context "" do
|
11
18
|
let(:argv) { %w(cloudips update) }
|
12
19
|
|
@@ -14,5 +21,63 @@ describe "brightbox cloudips" do
|
|
14
21
|
expect { output }.to_not raise_error
|
15
22
|
end
|
16
23
|
end
|
24
|
+
|
25
|
+
context "when name is updated" do
|
26
|
+
let(:argv) { ["cloudips", "update", "--name=#{new_name}", "cip-12345"] }
|
27
|
+
|
28
|
+
let(:json_response) do
|
29
|
+
<<-EOS
|
30
|
+
{
|
31
|
+
"id":"cip-12345",
|
32
|
+
"name":"#{new_name}"
|
33
|
+
}
|
34
|
+
EOS
|
35
|
+
end
|
36
|
+
|
37
|
+
context "--name 'New name'" do
|
38
|
+
let(:new_name) { "New name" }
|
39
|
+
let(:expected_args) { ["cip-12345", { :name => new_name }] }
|
40
|
+
|
41
|
+
before do
|
42
|
+
stub_request(:put, "http://api.brightbox.dev/1.0/cloud_ips/cip-12345?account_id=acc-12345")
|
43
|
+
.with(:headers => { "Content-Type" => "application/json" },
|
44
|
+
:body => hash_including("name" => "New name"))
|
45
|
+
.and_return(:status => 200, :body => json_response)
|
46
|
+
|
47
|
+
stub_request(:get, "http://api.brightbox.dev/1.0/cloud_ips/cip-12345?account_id=acc-12345")
|
48
|
+
.with(:headers => { "Content-Type" => "application/json" })
|
49
|
+
.and_return(:status => 200, :body => json_response)
|
50
|
+
end
|
51
|
+
|
52
|
+
it "puts new name in update" do
|
53
|
+
expect(Brightbox::CloudIP.conn).to receive(:update_cloud_ip).with(*expected_args).and_call_original
|
54
|
+
expect(stderr).to eq("")
|
55
|
+
expect(stdout).to include("cip-12345")
|
56
|
+
expect(stdout).to include("New name")
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
context "--name ''" do
|
61
|
+
let(:new_name) { "" }
|
62
|
+
let(:expected_args) { ["cip-12345", { :name => "" }] }
|
63
|
+
|
64
|
+
before do
|
65
|
+
stub_request(:put, "http://api.brightbox.dev/1.0/cloud_ips/cip-12345?account_id=acc-12345")
|
66
|
+
.with(:headers => { "Content-Type" => "application/json" },
|
67
|
+
:body => hash_including("name" => ""))
|
68
|
+
.and_return(:status => 200, :body => json_response)
|
69
|
+
|
70
|
+
stub_request(:get, "http://api.brightbox.dev/1.0/cloud_ips/cip-12345?account_id=acc-12345")
|
71
|
+
.with(:headers => { "Content-Type" => "application/json" })
|
72
|
+
.and_return(:status => 200, :body => json_response)
|
73
|
+
end
|
74
|
+
|
75
|
+
it "puts new name in update" do
|
76
|
+
expect(Brightbox::CloudIP.conn).to receive(:update_cloud_ip).with(*expected_args).and_call_original
|
77
|
+
expect(stderr).to eq("")
|
78
|
+
expect(stdout).to include("cip-12345")
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
17
82
|
end
|
18
83
|
end
|
@@ -104,6 +104,32 @@ describe "brightbox sql instances" do
|
|
104
104
|
end
|
105
105
|
end
|
106
106
|
|
107
|
+
context "--snapshot=dbi-1493j" do
|
108
|
+
let(:argv) { ["sql", "instances", "create", "--snapshot=dbi-1493j"] }
|
109
|
+
let(:expected_args) { { :snapshot_id => "dbi-1493j" } }
|
110
|
+
|
111
|
+
let(:json_response) do
|
112
|
+
<<-EOS
|
113
|
+
{
|
114
|
+
"id":"dbs-12345"
|
115
|
+
}
|
116
|
+
EOS
|
117
|
+
end
|
118
|
+
|
119
|
+
before do
|
120
|
+
stub_request(:post, "http://api.brightbox.dev/1.0/database_servers?account_id=acc-12345")
|
121
|
+
.with(:headers => { "Content-Type" => "application/json" },
|
122
|
+
:body => hash_including("snapshot" => "dbi-1493j"))
|
123
|
+
.and_return(:status => 202, :body => json_response)
|
124
|
+
end
|
125
|
+
|
126
|
+
it "includes schedule fields in response" do
|
127
|
+
expect(Brightbox::DatabaseServer).to receive(:create).with(expected_args).and_call_original
|
128
|
+
expect(stdout).to include("id: dbs-12345")
|
129
|
+
expect(stderr).to eql("")
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
107
133
|
context "--snapshots-schedule='0 12 * * 4'" do
|
108
134
|
let(:argv) { ["sql", "instances", "create", "--snapshots-schedule=0 12 * * 4"] }
|
109
135
|
let(:expected_args) { { :snapshots_schedule => "0 12 * * 4" } }
|