sct 1.4.0 → 1.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/cluster/lib/cluster/commands_generator.rb +1 -10
- data/cluster/lib/cluster/runner.rb +11 -18
- data/henk/lib/henk/commands_generator.rb +5 -13
- data/henk/lib/henk/runner.rb +0 -4
- data/sct/lib/sct/commands/dev.rb +4 -10
- data/sct/lib/sct/commands_generator.rb +28 -23
- data/sct/lib/sct/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6174ec229e164ecad94e54eb0fb937e0865338089ecf290fae57751d7313998
|
4
|
+
data.tar.gz: a5d71d905571d2e726beed402319f3059d365f23e9374571b33f940b198e2e6b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c979c3c547a15d7cdb44261438f7c13953dec46267476ff2dc6dfd25dba31ba0bf2db0be36c6d74d0b4be4381a0d74d9d2c8c6c69aff852f63173afaa109964c
|
7
|
+
data.tar.gz: 9917917ce9c87a6d1102d6e4769e3a0ac3b593996487015b19517ee359f9d2f44c6e5364648555664514f1c09af3752cf2e2e08245655f85834cc19d58ab5667
|
@@ -18,7 +18,7 @@ module Cluster
|
|
18
18
|
|
19
19
|
command :start do |c|
|
20
20
|
c.syntax = "sct cluster start"
|
21
|
-
c.description = "start the cluster"
|
21
|
+
c.description = "(re)start the cluster"
|
22
22
|
c.option '--build', '(re)build images before starting'
|
23
23
|
c.option '--pull', 'pull latest images before starting'
|
24
24
|
|
@@ -36,15 +36,6 @@ module Cluster
|
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
|
-
command :restart do |c|
|
40
|
-
c.syntax = "sct cluster restart"
|
41
|
-
c.description = "restart the cluster"
|
42
|
-
|
43
|
-
c.action do |args, options|
|
44
|
-
Cluster::Runner.new.restart
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
39
|
command :delete do |c|
|
49
40
|
c.syntax = "sct cluster delete"
|
50
41
|
c.description = "delete the cluster"
|
@@ -1,6 +1,8 @@
|
|
1
1
|
module Cluster
|
2
2
|
class Runner
|
3
3
|
|
4
|
+
@@dc = system("docker compose version", out: "/dev/null", err: "/dev/null") ? "docker compose" : "docker-compose"
|
5
|
+
|
4
6
|
def run command, options = {}
|
5
7
|
begin
|
6
8
|
if !system command, options
|
@@ -11,27 +13,22 @@ module Cluster
|
|
11
13
|
end
|
12
14
|
end
|
13
15
|
|
14
|
-
def
|
15
|
-
|
16
|
-
end
|
17
|
-
|
18
|
-
def run_dc command, options = {}
|
19
|
-
run "#{dc_system} -f ~/development/spend-cloud/docker-compose.yml #{command}", options
|
16
|
+
def dc command, options = {}
|
17
|
+
run "#{@@dc} -f ~/development/spend-cloud/docker-compose.yml #{command}", options
|
20
18
|
end
|
21
19
|
|
22
20
|
def start args, options
|
23
|
-
print "DC_SYSTEM: #{dc_system}"
|
24
21
|
if options.pull
|
25
|
-
|
22
|
+
dc "pull"
|
26
23
|
end
|
27
24
|
|
28
25
|
if options.build
|
29
|
-
|
26
|
+
dc "build #{options.pull ? "--pull" : ""}"
|
30
27
|
end
|
31
28
|
|
32
29
|
run "docker container prune -f"
|
33
30
|
|
34
|
-
|
31
|
+
dc "up --detach --remove-orphans --force-recreate --always-recreate-deps"
|
35
32
|
|
36
33
|
if options.pull or options.build
|
37
34
|
system "docker image prune -f"
|
@@ -41,15 +38,11 @@ module Cluster
|
|
41
38
|
end
|
42
39
|
|
43
40
|
def stop
|
44
|
-
|
45
|
-
end
|
46
|
-
|
47
|
-
def restart
|
48
|
-
run_dc "restart"
|
41
|
+
dc "down --remove-orphans"
|
49
42
|
end
|
50
43
|
|
51
44
|
def delete
|
52
|
-
|
45
|
+
dc "down --remove-orphans -v"
|
53
46
|
end
|
54
47
|
|
55
48
|
def reset args, options
|
@@ -58,7 +51,7 @@ module Cluster
|
|
58
51
|
end
|
59
52
|
|
60
53
|
def status
|
61
|
-
|
54
|
+
dc "ps"
|
62
55
|
end
|
63
56
|
|
64
57
|
def logs args, options
|
@@ -68,7 +61,7 @@ module Cluster
|
|
68
61
|
command << " --timestamps" if options.t or options.timestamps
|
69
62
|
command << " --tail #{options.tail}" if options.tail
|
70
63
|
|
71
|
-
|
64
|
+
dc "#{command} #{args.join " "}"
|
72
65
|
end
|
73
66
|
|
74
67
|
end
|
@@ -105,17 +105,8 @@ module Henk
|
|
105
105
|
end
|
106
106
|
end
|
107
107
|
|
108
|
-
command :"list-dumps" do |c|
|
109
|
-
c.syntax = 'sct henk list-dumps'
|
110
|
-
c.description = 'List the customer dumps currently available for import.'
|
111
|
-
|
112
|
-
c.action do |args, options|
|
113
|
-
Henk::Runner.new.list_dumps args, options
|
114
|
-
end
|
115
|
-
end
|
116
|
-
|
117
108
|
command :"import" do |c|
|
118
|
-
c.syntax = 'sct henk import'
|
109
|
+
c.syntax = 'sct henk import [<URL>]'
|
119
110
|
c.description = 'Import a customer dump from GCP.'
|
120
111
|
|
121
112
|
c.action do |args, options|
|
@@ -123,7 +114,8 @@ module Henk
|
|
123
114
|
when 0
|
124
115
|
puts "Loading available customer dumps...".blue
|
125
116
|
|
126
|
-
available_dumps = `
|
117
|
+
available_dumps = `gsutil ls gs://henk-db-dumps/`.lines chomp: true
|
118
|
+
|
127
119
|
begin
|
128
120
|
dump_url = choose do |menu|
|
129
121
|
menu.prompt = "Please choose a dump to import:"
|
@@ -133,8 +125,8 @@ module Henk
|
|
133
125
|
end
|
134
126
|
end
|
135
127
|
rescue Interrupt
|
136
|
-
|
137
|
-
|
128
|
+
# user pressed Ctrl+C, return in order to exit gracefully
|
129
|
+
return
|
138
130
|
end
|
139
131
|
when 1
|
140
132
|
dump_url = args.first
|
data/henk/lib/henk/runner.rb
CHANGED
data/sct/lib/sct/commands/dev.rb
CHANGED
@@ -3,6 +3,8 @@ require 'yaml'
|
|
3
3
|
module Sct
|
4
4
|
class DevCommand
|
5
5
|
|
6
|
+
@@dc = system("docker compose version", out: "/dev/null", err: "/dev/null") ? "docker compose" : "docker-compose"
|
7
|
+
|
6
8
|
@@file = "docker-compose.dev.yml"
|
7
9
|
|
8
10
|
def error message
|
@@ -10,17 +12,12 @@ module Sct
|
|
10
12
|
exit 1
|
11
13
|
end
|
12
14
|
|
13
|
-
def dc_system
|
14
|
-
return executer = system("which docker-compose") ? 'docker-compose' : 'docker compose'
|
15
|
-
end
|
16
|
-
|
17
15
|
def dc command, env = {}
|
18
|
-
system env, "#{
|
16
|
+
system env, "#{@@dc} -f ~/development/spend-cloud/docker-compose.yml #{command}"
|
19
17
|
end
|
20
18
|
|
21
19
|
def dc_dev command, env = {}
|
22
|
-
|
23
|
-
system env, "#{dc_system} -f #{@@file} #{command}"
|
20
|
+
system env, "#{@@dc} -f #{@@file} #{command}"
|
24
21
|
end
|
25
22
|
|
26
23
|
def manifest
|
@@ -32,9 +29,6 @@ module Sct
|
|
32
29
|
end
|
33
30
|
|
34
31
|
def execute args, options
|
35
|
-
|
36
|
-
UI.message('Trying to start development environment')
|
37
|
-
|
38
32
|
services = manifest["services"].to_a
|
39
33
|
|
40
34
|
if Sct::Helper.is_windows?
|
@@ -17,28 +17,21 @@ module Sct
|
|
17
17
|
|
18
18
|
global_option('--verbose') { $verbose = true }
|
19
19
|
|
20
|
-
command :'mysql-proxy' do |c|
|
21
|
-
c.syntax = 'sct mysql-proxy'
|
22
|
-
c.description = 'setup google mysql proxy'
|
23
|
-
|
24
|
-
c.action do |args, options|
|
25
|
-
UI.important("Trying to setup mysql proxy")
|
26
|
-
Sct::MysqlproxyCommand.new.execute args, options
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
20
|
command :'cluster' do |c|
|
31
21
|
c.syntax = 'sct cluster'
|
32
22
|
c.description = 'make changes to the cluster'
|
33
23
|
end
|
34
24
|
|
35
|
-
command :'
|
36
|
-
c.syntax = 'sct
|
37
|
-
c.description = '
|
38
|
-
c.option '--
|
25
|
+
command :'database-pull' do |c|
|
26
|
+
c.syntax = 'sct database pull'
|
27
|
+
c.description = 'pull database changes for proactive frame and proactive config'
|
28
|
+
c.option '--all', 'pull the database changes for all repositories'
|
29
|
+
c.option '--proactive-frame', 'pull the database changes from proactive-frame'
|
30
|
+
c.option '--proactive-config', 'pull the database changes from proactive-config'
|
39
31
|
|
40
32
|
c.action do |args, options|
|
41
|
-
|
33
|
+
UI.important("Trying to pull database")
|
34
|
+
Sct::DatabasePullCommand.new.execute args, options
|
42
35
|
end
|
43
36
|
end
|
44
37
|
|
@@ -54,16 +47,28 @@ module Sct
|
|
54
47
|
end
|
55
48
|
end
|
56
49
|
|
57
|
-
command :'
|
58
|
-
c.syntax = 'sct
|
59
|
-
c.description = '
|
60
|
-
|
61
|
-
|
62
|
-
|
50
|
+
command :'henk' do |c|
|
51
|
+
c.syntax = 'sct henk'
|
52
|
+
c.description = 'manage clients on your cluster'
|
53
|
+
end
|
54
|
+
|
55
|
+
command :'mysql-proxy' do |c|
|
56
|
+
c.syntax = 'sct mysql-proxy'
|
57
|
+
c.description = 'setup google mysql proxy'
|
63
58
|
|
64
59
|
c.action do |args, options|
|
65
|
-
UI.important("Trying to
|
66
|
-
Sct::
|
60
|
+
UI.important("Trying to setup mysql proxy")
|
61
|
+
Sct::MysqlproxyCommand.new.execute args, options
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
command :'shell' do |c|
|
66
|
+
c.syntax = 'sct shell'
|
67
|
+
c.description = 'run commands from the shell using docker containers'
|
68
|
+
c.option '--root', 'run as root user in the container'
|
69
|
+
|
70
|
+
c.action do |args, options|
|
71
|
+
Sct::ShellCommand.new.execute args, options
|
67
72
|
end
|
68
73
|
end
|
69
74
|
|
data/sct/lib/sct/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sct
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Reshad Farid
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-09-
|
11
|
+
date: 2022-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colored
|
@@ -243,19 +243,19 @@ files:
|
|
243
243
|
- sct_core/lib/sct_core/ui/interface.rb
|
244
244
|
- sct_core/lib/sct_core/ui/ui.rb
|
245
245
|
- sct_core/lib/sct_core/update_checker/update_checker.rb
|
246
|
-
homepage: https://
|
246
|
+
homepage: https://github.com/Spend-Cloud/sct
|
247
247
|
licenses:
|
248
248
|
- MIT
|
249
249
|
metadata:
|
250
|
-
homepage_uri: https://
|
251
|
-
source_code_uri: https://
|
252
|
-
changelog_uri: https://
|
250
|
+
homepage_uri: https://github.com/Spend-Cloud/sct
|
251
|
+
source_code_uri: https://github.com/Spend-Cloud/sct
|
252
|
+
changelog_uri: https://github.com/Spend-Cloud/sct
|
253
253
|
post_install_message:
|
254
254
|
rdoc_options: []
|
255
255
|
require_paths:
|
256
|
-
- cluster/lib
|
257
256
|
- henk/lib
|
258
257
|
- sct/lib
|
258
|
+
- cluster/lib
|
259
259
|
- sct_core/lib
|
260
260
|
required_ruby_version: !ruby/object:Gem::Requirement
|
261
261
|
requirements:
|
@@ -268,7 +268,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
268
268
|
- !ruby/object:Gem::Version
|
269
269
|
version: '0'
|
270
270
|
requirements: []
|
271
|
-
rubygems_version: 3.1
|
271
|
+
rubygems_version: 3.0.3.1
|
272
272
|
signing_key:
|
273
273
|
specification_version: 4
|
274
274
|
summary: Spend Cloud Tool.
|