cloud-sh 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ace6a92c85bd1ea136ee38152b2056b35eed1dda61f7bde6762dd3f68e0a72e4
4
- data.tar.gz: 782c99a946c4f19d4728f4d7e2f8373acd3d33e4d0e08af893bc4c0af19cc59d
3
+ metadata.gz: 8a078e2085e381b44ed5b0d695fdeb3e5418184680e435c1eeaa381aa1cfd4eb
4
+ data.tar.gz: 94afa27d8d6cb670f3d263159d09191041bc1886f0f95e061c80751d5bc43fc0
5
5
  SHA512:
6
- metadata.gz: 0b7374c2e6d431b90e91e76525ee5b2a19e406d7d2dd4e5accddecbdd858d2cfa0eb9cc6b6dd42fa2d31634adbbd58774b7734d6861905316e47584978c9ef15
7
- data.tar.gz: 505b814eeaa67d62e0e8821604011ffdcb2b9205066f7711f1e2c505e425de9ac426b9b6ddba87187d48191dcd806b2942a3450d22351223b688df86bb4837e2
6
+ metadata.gz: 28180a196c438a4c620a52d62657506b071387c3d41417ea578fd4ded07537f4e803d8225de699886725f402f800c0b0bcc99dd15accf852e5901387cbf79019
7
+ data.tar.gz: 7fe2dfb29b1b7d187c09768d6675ea3e6bc9ed56056f4150cf9c8c3734fbc4a9407c47ed0a79ad19e3e41da894e6e0d68f88a9837db78b501d1dcc1297fb06e9
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cloud-sh (1.0.2)
4
+ cloud-sh (1.0.3)
5
5
  gli
6
6
 
7
7
  GEM
@@ -47,6 +47,7 @@ module Cloud
47
47
  provider = cloud_provider(account)
48
48
  provider.databases do |database|
49
49
  next if database.cluster.ignore
50
+
50
51
  if database.cluster.engine == "pg"
51
52
  add_alias(:do, account, :psql, database.cluster, database.name, "psql \\\"#{database.uri}\\\"")
52
53
  add_alias(:do, account, :pgdump, database.cluster, database.name, pgdump_command(database))
@@ -72,10 +73,10 @@ module Cloud
72
73
  add_alias(:k8s, account, :switch, :to, cluster, kubectl("config use-context", cluster.context))
73
74
  add_alias(:k8s, account, :ctl, cluster, kubectl("--context #{cluster.context}"))
74
75
  cluster.pods.each do |namespace, pods|
75
- add_alias(:k8s, account, :tail, cluster, namespace, :all, "cloud-sh k8s tail --context #{cluster.context} --namespace #{namespace}")
76
+ add_alias(:k8s, account, cluster, namespace, :tail, :all, "cloud-sh k8s tail --context #{cluster.context} --namespace #{namespace}")
76
77
  pods.each do |pod|
77
- add_alias(:k8s, account, :tail, cluster, namespace, pod.name, "cloud-sh k8s tail --context #{cluster.context} --namespace #{namespace} --pod #{pod.name}") unless pod.name == "console"
78
- add_alias(:k8s, account, :exec, cluster, namespace, pod.name, "cloud-sh k8s exec --context #{cluster.context} --namespace #{namespace} --pod #{pod.name}")
78
+ add_alias(:k8s, account, cluster, namespace, :tail, pod.name, "cloud-sh k8s tail --context #{cluster.context} --namespace #{namespace} --pod #{pod.name}") unless pod.name == "console"
79
+ add_alias(:k8s, account, cluster, namespace, :exec, pod.name, "cloud-sh k8s exec --context #{cluster.context} --namespace #{namespace} --pod #{pod.name}")
79
80
  add_alias(:k8s, account, cluster, namespace, :rails, :console, "cloud-sh k8s exec --context #{cluster.context} --namespace #{namespace} --pod #{pod.name} --cmd 'bundle exec rails console'") if pod.name == "console"
80
81
  end
81
82
  end
@@ -98,7 +99,7 @@ module Cloud
98
99
 
99
100
  def mysqldump_command(database)
100
101
  uri = URI.parse(database.uri)
101
- dump_name = "#{database.db}-`date +%s`.sql"
102
+ dump_name = "#{database.name}-`date +%Y%m%d%H%M`.sql"
102
103
  [ :mysqldump, mysql_connection_params(uri), uri.path.delete("/"), "> #{dump_name}"].join(" ")
103
104
  end
104
105
 
@@ -113,7 +114,7 @@ module Cloud
113
114
  end
114
115
 
115
116
  def pgdump_command(database)
116
- dump_name = "#{database.db}-`date +%s`.sql"
117
+ dump_name = "#{database.name}-`date +%Y%m%d%H%M`.sql"
117
118
  "pg_dump \\\"#{database.uri}\\\" -f #{dump_name}"
118
119
  end
119
120
 
@@ -124,6 +125,7 @@ module Cloud
124
125
 
125
126
  def normalize_alias_part(part)
126
127
  return nil if part.respond_to?(:default) && part.default
128
+
127
129
  if part.respond_to?(:alias)
128
130
  part = part.alias
129
131
  elsif part.respond_to?(:name)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Cloud
4
4
  module Sh
5
- VERSION = "1.0.3"
5
+ VERSION = "1.0.4"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloud-sh
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cristian Bica
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-09-02 00:00:00.000000000 Z
11
+ date: 2019-09-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gli