dh-proteus 0.3.0 → 0.3.1
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/proteus/global_commands/validate.rb +21 -0
- data/lib/proteus/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: 8fb5e638db16f99a0788b308916d6788599591155e71f0b3112ba14efa899c03
|
4
|
+
data.tar.gz: 5b76029b2b37a7db6c28ffef458514f84eee2a3a08f05376d7f5e199de2ce96d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27daef8b98d42b544611c2f411cd7b454b4e4706b4acbf263e0cd716c6d46ce37927ec86aa61acba8aa8923dc6e5eea9d382ddc812737e49d393c4c212faa7de
|
7
|
+
data.tar.gz: aca86a828d979fff964167e593a74d1e0eb416feeb10a8391b1c4fe6e340cd57d4c32fc3e7f0a6a50eb8e352ff9606599dad228440b3770215b94fc969ed159f
|
@@ -14,8 +14,29 @@ module Proteus
|
|
14
14
|
long_desc <<-LONGDESC
|
15
15
|
Renders templates for all environments, reporting validation errors.
|
16
16
|
LONGDESC
|
17
|
+
option :selective, type: :boolean, default: false
|
17
18
|
def validate
|
19
|
+
# case 1: changes in root => run full validation
|
20
|
+
# case 2: no changes in root => run contexts only
|
21
|
+
status = `git --no-pager diff origin/master --stat --name-only`.split("\n")
|
22
|
+
|
23
|
+
run_full_validation = if status.map {|l| !l.include?('/') }.any? || !options[:selective]
|
24
|
+
say "Found changes in the root of the repository or --selective is not set. Running full validation.", :green
|
25
|
+
true
|
26
|
+
else
|
27
|
+
say "Running selective validation.", :green
|
28
|
+
false
|
29
|
+
end
|
30
|
+
selected_contexts = status.map { |s| s.scan(/contexts\/([a-zA-Z0-9_]+)\/((.+)\/)?/).flatten.first }.reject { |s| s.nil? }.uniq!
|
31
|
+
|
18
32
|
self.class.contexts.each do |context|
|
33
|
+
unless run_full_validation
|
34
|
+
if !selected_contexts.include?(context.name)
|
35
|
+
say "Skipping context #{context.name}.", :green
|
36
|
+
next
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
19
40
|
context.environments.each do |environment|
|
20
41
|
module_manager = Proteus::Modules::Manager.new(context: context.name, environment: environment)
|
21
42
|
module_manager.render_modules
|
data/lib/proteus/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dh-proteus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simon Albrecht
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-09-
|
11
|
+
date: 2020-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|