sct 0.1.12 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/sct/commands/hostfile.rb +24 -9
- data/lib/sct/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8bd1ac3662dc8475d5837a4736765063bdbbc5ed1b3471a6c26ab8d007be85b6
|
4
|
+
data.tar.gz: 3ed935254cd71bbe3b505046ef2243c1a3a4df4b23826a7fcfbe2d64c28da0fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4111e359e86ebcf1a8df22534acc55f0ad6ebed32540c1068f4b094718156e49a1b2083fd9c1391e04eca44763c2dfa0f847fee4f48d4ffe6eb052f1a6640364
|
7
|
+
data.tar.gz: 0ab52f35394748422cad25e3745daf770846a82add1a0601cbbf9b8641b04694db78651d075ef10c1ebaa396167998650d41b1728e80cb98f320827114fb9294
|
@@ -36,17 +36,32 @@ module Sct
|
|
36
36
|
end
|
37
37
|
|
38
38
|
hosts_paths.each do |hosts_path|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
39
|
+
|
40
|
+
begin
|
41
|
+
hosts = Hosts::File.read(hosts_path)
|
42
|
+
|
43
|
+
if ([ingressAddress].any? { |ip| hosts.to_s =~ /#{ip}/ })
|
44
|
+
puts "Skipped patching #{hosts_path} (already up to date)".green
|
45
|
+
else
|
46
|
+
validate_if_exist(hosts)
|
47
|
+
add_entry(ingressAddress, hosts)
|
48
|
+
hosts.write
|
49
|
+
puts "Patched #{hosts_path} with #{ingressAddress}".green
|
50
|
+
end
|
51
|
+
rescue ArgumentError
|
52
|
+
puts "🔥 Can't read your hostfile".red
|
53
|
+
puts " Please update your hostsfile manually at #{hosts_path} with the following entries"
|
54
|
+
puts " "
|
55
|
+
puts " #{ingressAddress} spend.cloud.local".yellow
|
56
|
+
puts " #{ingressAddress} mail.spend.cloud.local".yellow
|
57
|
+
puts " #{ingressAddress} config.spend.cloud.local".yellow
|
58
|
+
puts " #{ingressAddress} spend-cloud.spend.cloud.local".yellow
|
59
|
+
puts " #{ingressAddress} docs.spend.cloud.local".yellow
|
60
|
+
puts " "
|
48
61
|
end
|
62
|
+
|
49
63
|
end
|
64
|
+
|
50
65
|
end
|
51
66
|
|
52
67
|
def add_entry(url, hosts)
|
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.13
|
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-02-
|
11
|
+
date: 2020-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: class_interface
|