sct 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sct/commands/cluster.rb +38 -0
- data/lib/sct/commands/init.rb +6 -6
- data/lib/sct/sct_folder.rb +5 -5
- data/lib/sct/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d0ca9b99be4c5113497c4a114266df1434b03cbc5c704d241be685740d3d83e
|
4
|
+
data.tar.gz: f623453bd6b418b9feeec0eee04d553a3614498909b297fb843b63c12fcb0ffb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e31a534cd979e93dc7902bd634b92f7f375a6e047885b976aef36fc331928245684cbd9d881b6172087ea73e713c19b382312274933b456a38d9f84e05f1b312
|
7
|
+
data.tar.gz: 39a7ec02f097a063d898f216a02997e0080657aaf92ec8020fa8baed582796948e50212776387211c6f9e1c7e43358e27e2d609f44f971aa1841237d72f1c078
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'sct/command_interface'
|
2
|
+
|
3
|
+
module Sct
|
4
|
+
|
5
|
+
class ClusterCommand
|
6
|
+
|
7
|
+
IS_PUBLIC_COMMAND = true
|
8
|
+
SYNTAX = 'sct cluster'
|
9
|
+
SUMMARY = 'Starts or stops the minikube cluster'
|
10
|
+
EXAMPLE = 'sct cluster up'
|
11
|
+
EXAMPLE_DESCRIPTION = 'Starts the spend cloud cluster'
|
12
|
+
DESCRIPTION = "Sct cluster allows you to start and stop the Spend Cloud minikube cluster"
|
13
|
+
|
14
|
+
OPTIONS = []
|
15
|
+
|
16
|
+
def initialize
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
def execute(args, options)
|
21
|
+
case args[0]
|
22
|
+
when "up"
|
23
|
+
system("minikube start")
|
24
|
+
system("minikube ssh -- 'sudo su -c \"echo 10048576 > /proc/sys/fs/inotify/max_user_watches\"'")
|
25
|
+
system("kubectl delete pod -n kube-system $(kubectl get pods -n kube-system | grep registry-creds | awk '{print $1}')")
|
26
|
+
puts "\n✔️ You can now visit your environment at 👉 https://spend-cloud.spend.cloud.local 👌"
|
27
|
+
when "down"
|
28
|
+
system("minikube stop")
|
29
|
+
else
|
30
|
+
puts "Unknown or missing argument. Please run 'sct cluster up' or 'sct cluster down'"
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
implements CommandInterface
|
35
|
+
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
data/lib/sct/commands/init.rb
CHANGED
@@ -5,11 +5,11 @@ module Sct
|
|
5
5
|
class InitCommand
|
6
6
|
|
7
7
|
IS_PUBLIC_COMMAND = true
|
8
|
-
SYNTAX = '
|
9
|
-
SUMMARY = 'Initialize a base configuration file for
|
10
|
-
EXAMPLE = '
|
11
|
-
EXAMPLE_DESCRIPTION = '
|
12
|
-
DESCRIPTION = "
|
8
|
+
SYNTAX = 'sct init'
|
9
|
+
SUMMARY = 'Initialize a base configuration file for sct'
|
10
|
+
EXAMPLE = 'sct init'
|
11
|
+
EXAMPLE_DESCRIPTION = 'sct init will create a sct folder inside your working directory and a Sctfile'
|
12
|
+
DESCRIPTION = "sct init will create a configuration file called Sctfile in your project"
|
13
13
|
|
14
14
|
OPTIONS = []
|
15
15
|
|
@@ -18,7 +18,7 @@ module Sct
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def execute(args, options)
|
21
|
-
require "
|
21
|
+
require "sct/setup/setup"
|
22
22
|
Sct::Setup.start
|
23
23
|
end
|
24
24
|
|
data/lib/sct/sct_folder.rb
CHANGED
@@ -10,7 +10,7 @@ module Sct
|
|
10
10
|
return value
|
11
11
|
end
|
12
12
|
|
13
|
-
def self.
|
13
|
+
def self.sctfile_path
|
14
14
|
return nil if self.path.nil?
|
15
15
|
|
16
16
|
path = File.join(self.path, 'Sctfile')
|
@@ -18,16 +18,16 @@ module Sct
|
|
18
18
|
return nil
|
19
19
|
end
|
20
20
|
|
21
|
-
# Does a
|
21
|
+
# Does a sct configuration already exist?
|
22
22
|
def self.setup?
|
23
|
-
return false unless self.
|
24
|
-
File.exist?(self.
|
23
|
+
return false unless self.sctfile_path
|
24
|
+
File.exist?(self.sctfile_path)
|
25
25
|
end
|
26
26
|
|
27
27
|
def self.create_folder!(path = nil)
|
28
28
|
path = File.join(path || '.', FOLDER_NAME)
|
29
29
|
return if File.directory?(path) # directory is already there
|
30
|
-
puts "Found a folder called '
|
30
|
+
puts "Found a folder called 'sct' at path '#{path}', please delete it" if File.exist?(path)
|
31
31
|
FileUtils.mkdir_p(path)
|
32
32
|
puts "Created new folder '#{path}'."
|
33
33
|
end
|
data/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: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Reshad Farid
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-01-
|
11
|
+
date: 2020-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: class_interface
|
@@ -150,6 +150,7 @@ files:
|
|
150
150
|
- lib/sct/command.rb
|
151
151
|
- lib/sct/command_interface.rb
|
152
152
|
- lib/sct/command_option.rb
|
153
|
+
- lib/sct/commands/cluster.rb
|
153
154
|
- lib/sct/commands/hostfile.rb
|
154
155
|
- lib/sct/commands/init.rb
|
155
156
|
- lib/sct/commands/mysqlproxy.rb
|