bbc-cosmos-tools 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -0
- data/lib/bbc/cosmos/tools/commands/component.rb +17 -3
- data/lib/bbc/cosmos/tools/commands/stack.rb +3 -5
- data/lib/bbc/cosmos/tools/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 33f0ae16de67d0b0f168224dcd626d309b267f41
|
4
|
+
data.tar.gz: 4abd19d8284fe959724fefea4e595d5eb5bd0bb4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b87ca39df5f43f6dbfb3975ccf0e7158ccef62943658f14f4c6f26c9f7414e9e27d6000c75855788dc24c0f8a9366bcc7cd730fa1688dead1e3c9ace42806591
|
7
|
+
data.tar.gz: 70670e8e77bac0d593c2f42d4c3cce2a715ef3943b36c5e274727b24410cc675dd91d245043ddfdc6268103ded5dee268638a259f3d515d014075c9e4aa26102
|
data/README.md
CHANGED
@@ -354,6 +354,12 @@ bbc-cosmos-tools stack generate {cosmos_component_name} \
|
|
354
354
|
|
355
355
|
> Note: in case you're not a CLI wizard, instead of specifying the `--key-path` option you can set a `$DEV_CERT_PATH` environment variable that the tool uses by default if it detects it. Inside your shell's configuration file (either `~/.bashrc` or `~/.zshrc`) you'll want to add `export DEV_CERT_PATH=/custom/path/to/your/pem/certificate`
|
356
356
|
|
357
|
+
Deploy component to a specific environment:
|
358
|
+
|
359
|
+
```sh
|
360
|
+
bbc-cosmos-tools release deploy <component> --project=<project> --from=X --env=Y
|
361
|
+
```
|
362
|
+
|
357
363
|
### Using YAML or JSON
|
358
364
|
|
359
365
|
Use the same commands as above but make sure to include a `--type={yaml|json}`. If it's not specified then `cfndsl` is assumed as the default (almost as if you had written `--type=cfndsl`, but it's clearer to just remove the flag in that instance).
|
@@ -29,8 +29,9 @@ module BBC
|
|
29
29
|
print_table build_table(headers, rows)
|
30
30
|
end
|
31
31
|
|
32
|
-
desc "
|
32
|
+
desc "ssh <COMPONENT>", "Gain SSH"
|
33
33
|
def ssh(component)
|
34
|
+
say banner(component) + "\n"
|
34
35
|
meta = make_request("env/#{options[:env]}/component/#{component}/instances")
|
35
36
|
|
36
37
|
meta.count == 1 ? single_instance(component, meta)
|
@@ -55,10 +56,23 @@ module BBC
|
|
55
56
|
end
|
56
57
|
|
57
58
|
def session(component, instance_id, ip_address)
|
58
|
-
post_data(component, instance_id)
|
59
|
+
response = post_data(component, instance_id)
|
60
|
+
check_status(response)
|
59
61
|
output_message(component, ip_address, instance_id)
|
60
62
|
end
|
61
63
|
|
64
|
+
def check_status(login)
|
65
|
+
url = JSON.parse(login.body)['url']
|
66
|
+
status = "pending_creation"
|
67
|
+
say "\n"
|
68
|
+
until status == "current"
|
69
|
+
sleep 2
|
70
|
+
say "Creating Session", :yellow
|
71
|
+
status = make_request(url)["status"]
|
72
|
+
fail Exception, (say "SSH Failed"; :red) if status == "failed"
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
62
76
|
def select_instance(meta)
|
63
77
|
choose do |menu|
|
64
78
|
say "Multiple instances detected, please select one", :green
|
@@ -74,7 +88,7 @@ module BBC
|
|
74
88
|
end
|
75
89
|
|
76
90
|
def output_message(component, ip, id)
|
77
|
-
say "
|
91
|
+
say "\nYour IP for #{id} is #{ip}", :green
|
78
92
|
end
|
79
93
|
|
80
94
|
def post_data(component, id)
|
@@ -125,7 +125,7 @@ module BBC
|
|
125
125
|
|
126
126
|
if data["Parameters"]
|
127
127
|
data["Parameters"] = deep_merge(
|
128
|
-
stack_parameters(stack_meta["parameters"]),
|
128
|
+
stack_parameters(stack_meta["parameters"], data["Parameters"]),
|
129
129
|
data["Parameters"]
|
130
130
|
)
|
131
131
|
|
@@ -202,12 +202,10 @@ module BBC
|
|
202
202
|
|
203
203
|
private
|
204
204
|
|
205
|
-
def stack_parameters(stack_data)
|
205
|
+
def stack_parameters(stack_data, new_params)
|
206
206
|
stack_data.reduce({}) do |accum, (key, value)|
|
207
207
|
accum.tap do |a|
|
208
|
-
a[key] = {
|
209
|
-
"Default" => value["value"]
|
210
|
-
}
|
208
|
+
a[key] = { "Default" => value["value"] } if new_params.has_key? key
|
211
209
|
end
|
212
210
|
end
|
213
211
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bbc-cosmos-tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Jack
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|