govuk-connect 0.7.1 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/govuk_connect/cli.rb +31 -17
- data/lib/govuk_connect/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3809f92432d9568040b786cea22448406da43403917459d8bf96210457be9cd6
|
4
|
+
data.tar.gz: a606f53b33df1e4baa5c95f265c4fd078c886ec2f9d853c3950f087eb19b0201
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d47dce35c946feb4c5869eb3cbc3b7a6ac1796cdb668ecd79d79e4d19e19cd39800e9e593336239120d6681a6016e2f0c9a3561e7e6c6484f18eb1275ed002ed
|
7
|
+
data.tar.gz: 343c1544abe716c63783591c3a6d33a2cc83c03ad2bab7cb3ed273526c523dd8d46a362bd9d6333b513ea250b4c2655f2009f77d80c84cb4b6362aafbe27eb54
|
data/lib/govuk_connect/cli.rb
CHANGED
@@ -24,10 +24,6 @@ class GovukConnect::CLI
|
|
24
24
|
|
25
25
|
gds govuk connect scp-pull --environment integration backend /tmp/filename.txt ~/Downloads/
|
26
26
|
|
27
|
-
gds govuk connect app-console --environment staging publishing-api
|
28
|
-
|
29
|
-
gds govuk connect app-dbconsole -e integration whitehall_backend/whitehall
|
30
|
-
|
31
27
|
gds govuk connect rabbitmq -e staging aws/rabbitmq
|
32
28
|
|
33
29
|
gds govuk connect amazonmq -e integration
|
@@ -72,8 +68,8 @@ class GovukConnect::CLI
|
|
72
68
|
|
73
69
|
CONNECTION_TYPE_DESCRIPTIONS = {
|
74
70
|
"ssh" => "Connect to a machine through SSH.",
|
75
|
-
"app-console" => "
|
76
|
-
"app-dbconsole" => "Launch a
|
71
|
+
"app-console" => "(DEPRECATED; use kubectl instead) Launch a Rails console for an application.",
|
72
|
+
"app-dbconsole" => "(DEPRECATED; use kubectl instead) Launch a Rails database console for an application.",
|
77
73
|
"rabbitmq" => "Setup port forwarding to the RabbitMQ admin interface.",
|
78
74
|
"amazonmq" => "Setup port forwarding to the AmazonMQ admin interface.",
|
79
75
|
}.freeze
|
@@ -121,6 +117,11 @@ class GovukConnect::CLI
|
|
121
117
|
info "You may also wish to check that you are connected to the VPN, as attempting to SSH into an instance when NOT on the VPN can result in an operation timed out error"
|
122
118
|
end
|
123
119
|
|
120
|
+
def print_k8s_setup_info
|
121
|
+
info "If that doesn't work for you, follow the setup instructions at"
|
122
|
+
info "https://govuk-k8s-user-docs.publishing.service.gov.uk/get-started/access-eks-cluster\n"
|
123
|
+
end
|
124
|
+
|
124
125
|
# From Rosetta Code: https://rosettacode.org/wiki/Levenshtein_distance#Ruby
|
125
126
|
def levenshtein_distance(string1, string2)
|
126
127
|
string1 = string1.downcase
|
@@ -849,7 +850,7 @@ class GovukConnect::CLI
|
|
849
850
|
hosting,
|
850
851
|
)
|
851
852
|
|
852
|
-
if domains.
|
853
|
+
if domains.empty?
|
853
854
|
error "error: couldn't find #{name} in #{hosting}/#{environment}"
|
854
855
|
|
855
856
|
node_types = govuk_node_list_classes(environment, hosting)
|
@@ -915,20 +916,33 @@ class GovukConnect::CLI
|
|
915
916
|
end
|
916
917
|
end
|
917
918
|
|
919
|
+
def target_name_to_k8s_deployment(target_name)
|
920
|
+
{
|
921
|
+
/draft_[a-z_]+\/([a-z_-]+)/ => "draft-\\1",
|
922
|
+
/.*\// => "", # If not draft, drop the Puppet class prefix.
|
923
|
+
"whitehall_backend/whitehall" => "whitehall-admin",
|
924
|
+
"whitehall_frontend/whitehall" => "whitehall-frontend",
|
925
|
+
}.reduce(target_name) do |result, (pattern, replacement)|
|
926
|
+
result.sub(pattern, replacement)
|
927
|
+
end
|
928
|
+
end
|
929
|
+
|
918
930
|
def types
|
919
931
|
@types ||= {
|
920
|
-
"app-console" => proc do |target,
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
|
932
|
+
"app-console" => proc do |target, _environment, _args, _extra_args, _options|
|
933
|
+
target ||= "<app-name>"
|
934
|
+
deployment = target_name_to_k8s_deployment(target)
|
935
|
+
info "#{bold('The command for opening a Rails console has changed. Run this instead:')}\n\n"
|
936
|
+
info " k exec -it deploy/#{deployment} -- rails c\n\n"
|
937
|
+
print_k8s_setup_info
|
925
938
|
end,
|
926
939
|
|
927
|
-
"app-dbconsole" => proc do |target,
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
940
|
+
"app-dbconsole" => proc do |target, _environment, _args, _extra_args, _options|
|
941
|
+
target ||= "<app-name>"
|
942
|
+
deployment = target_name_to_k8s_deployment(target)
|
943
|
+
info "#{bold('The command for opening a Rails dbconsole has changed. Run this instead:')}\n\n"
|
944
|
+
info " k exec -it deploy/#{deployment} -- rails db\n\n"
|
945
|
+
print_k8s_setup_info
|
932
946
|
end,
|
933
947
|
|
934
948
|
"rabbitmq" => proc do |target, environment, args, extra_args, _options|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: govuk-connect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Government Digital Service
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: climate_control
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - '='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 4.
|
61
|
+
version: 4.10.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
|
-
version: 4.
|
68
|
+
version: 4.10.0
|
69
69
|
description: Command line tool to connect to GOV.UK infrastructure
|
70
70
|
email:
|
71
71
|
- govuk-dev@digital.cabinet-office.gov.uk
|
@@ -90,14 +90,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
90
90
|
requirements:
|
91
91
|
- - ">="
|
92
92
|
- !ruby/object:Gem::Version
|
93
|
-
version: '
|
93
|
+
version: '3.0'
|
94
94
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
95
|
requirements:
|
96
96
|
- - ">="
|
97
97
|
- !ruby/object:Gem::Version
|
98
98
|
version: '0'
|
99
99
|
requirements: []
|
100
|
-
rubygems_version: 3.4.
|
100
|
+
rubygems_version: 3.4.13
|
101
101
|
signing_key:
|
102
102
|
specification_version: 4
|
103
103
|
summary: govuk-connect command line tool
|