40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
|
# File 'lib/input_validator.rb', line 40
def validate_project_node project
@node_name = 'project'
msg = @simple_validator.method_exists project, 'is_root'
if msg.nil?
msg = @simple_validator.method_value_not_nil_or_empty project, 'is_root'
project.is_root = project.is_root.downcase == 'y' if msg.nil?
else
yield msg
end
yield @simple_validator.method_exists project, 'next'
yield @simple_validator.method_exists project, 'previous'
@node_name = 'project.metadata'
yield @simple_validator.method_exists project.metadata, 'repo_url'
yield @simple_validator.method_value_not_nil_or_empty project.metadata, 'repo_url'
yield @simple_validator.method_exists project.metadata, 'branch'
yield @simple_validator.method_value_not_nil_or_empty project.metadata, 'branch'
yield @simple_validator.method_exists project.metadata, 'should_upgrade'
msg = @simple_validator.method_value_not_nil_or_empty project.metadata, 'should_upgrade'
project.metadata.should_upgrade = project.metadata.should_upgrade.downcase == 'y' if msg.nil?
yield msg
yield @simple_validator.method_exists project.metadata, 'should_publish_nuget'
msg = @simple_validator.method_value_not_nil_or_empty project.metadata, 'should_publish_nuget'
project.metadata.should_publish_nuget = project.metadata.should_publish_nuget.downcase == 'y' if msg.nil?
yield msg
yield @simple_validator.method_exists project.metadata, 'env_vars'
yield @simple_validator.method_value_not_nil project.metadata, 'env_vars'
yield @simple_validator.method_exists project.metadata, 'status'
yield @simple_validator.method_value_not_nil_or_empty project.metadata, 'status'
yield @simple_validator.method_exists project.metadata, 'build_configuration_id'
yield @simple_validator.method_exists project.metadata, 'build_wait_time_in_secs'
@node_name = 'project.metadata.env_vars'
yield @simple_validator.method_exists project.metadata.env_vars, 'env'
yield @simple_validator.method_value_not_nil_or_empty project.metadata.env_vars, 'env'
yield @simple_validator.method_exists project.metadata.env_vars, 'service_name'
yield @simple_validator.method_value_not_nil_or_empty project.metadata.env_vars, 'service_name'
if !@test_mode
yield @simple_validator.method_exists project.metadata.env_vars, 'AI_InstrumentationKey'
yield @simple_validator.method_value_not_nil_or_empty project.metadata.env_vars, 'AI_InstrumentationKey'
yield @simple_validator.method_exists project.metadata.env_vars, 'AppClientId'
yield @simple_validator.method_value_not_nil_or_empty project.metadata.env_vars, 'AppClientId'
yield @simple_validator.method_exists project.metadata.env_vars, 'RuntimePath'
yield @simple_validator.method_value_not_nil_or_empty project.metadata.env_vars, 'RuntimePath'
yield @simple_validator.method_exists project.metadata.env_vars, 'SettingsAccount'
yield @simple_validator.method_value_not_nil_or_empty project.metadata.env_vars, 'SettingsAccount'
yield @simple_validator.method_exists project.metadata.env_vars, 'SettingsAccountKey'
yield @simple_validator.method_value_not_nil_or_empty project.metadata.env_vars, 'SettingsAccountKey'
yield @simple_validator.method_exists project.metadata.env_vars, 'unitestconnectionString'
yield @simple_validator.method_value_not_nil_or_empty project.metadata.env_vars, 'unitestconnectionString'
yield @simple_validator.method_exists project.metadata.env_vars, 'should_update_settings_connstr'
yield @simple_validator.method_value_not_nil_or_empty project.metadata.env_vars, 'should_update_settings_connstr'
end
@node_name = 'project.metadata.semver'
yield @simple_validator.method_exists project.metadata, 'semver'
yield @simple_validator.method_value_not_nil project.metadata, 'semver'
yield @simple_validator.method_exists project.metadata.semver, 'file'
yield @simple_validator.method_value_not_nil_or_empty project.metadata.semver, 'file'
yield @simple_validator.method_exists project.metadata.semver, 'dimension'
yield @simple_validator.method_value_not_nil_or_empty project.metadata.semver, 'dimension'
yield @simple_validator.method_exists project.metadata.semver, 'location'
end
|