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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9bacd93ef13d52b6b218f43b7d5f6b522f4572806506af40d6baf7bd01829d96
4
- data.tar.gz: feedea275908afa26178138c3433409878a7fc3580d12d8e720245781fa3a2b1
3
+ metadata.gz: 0d0ca9b99be4c5113497c4a114266df1434b03cbc5c704d241be685740d3d83e
4
+ data.tar.gz: f623453bd6b418b9feeec0eee04d553a3614498909b297fb843b63c12fcb0ffb
5
5
  SHA512:
6
- metadata.gz: e5ee00860cd8f572bf22cd36145756284401be05f613f80776243989d3181ca236cda7a04f64e2b2002783009193b149b2770d3854c48df1536e4b9ee1dc3d10
7
- data.tar.gz: 9e067e4768dd9885f2eb294c6be1f8243420b9bc7dea65f24c84129353944e1d9e532390d9647e778784735c2602bcc7be5ba44747a801ba0d11214de7e93c9d
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
@@ -5,11 +5,11 @@ module Sct
5
5
  class InitCommand
6
6
 
7
7
  IS_PUBLIC_COMMAND = true
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"
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 "Sct/setup/setup"
21
+ require "sct/setup/setup"
22
22
  Sct::Setup.start
23
23
  end
24
24
 
@@ -10,7 +10,7 @@ module Sct
10
10
  return value
11
11
  end
12
12
 
13
- def self.Sctfile_path
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 Sct configuration already exist?
21
+ # Does a sct configuration already exist?
22
22
  def self.setup?
23
- return false unless self.Sctfile_path
24
- File.exist?(self.Sctfile_path)
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 'Sct' at path '#{path}', please delete it" if File.exist?(path)
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
@@ -1,3 +1,3 @@
1
1
  module Sct
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
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.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-17 00:00:00.000000000 Z
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