apollo_commons_ruby 0.7.0
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 +7 -0
- data/.gitignore +8 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +19 -0
- data/README.md +40 -0
- data/Rakefile +2 -0
- data/apollo_commons_ruby-0.2.0.gem +0 -0
- data/apollo_commons_ruby-0.3.0.gem +0 -0
- data/apollo_commons_ruby-0.4.0.gem +0 -0
- data/apollo_commons_ruby-0.5.0.gem +0 -0
- data/apollo_commons_ruby-0.6.0.gem +0 -0
- data/apollo_commons_ruby.gemspec +26 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/apollo_commons_ruby.rb +34 -0
- data/lib/apollo_commons_ruby/DomainEvent.rb +122 -0
- data/lib/apollo_commons_ruby/FileUtils.rb +41 -0
- data/lib/apollo_commons_ruby/MarioEvent.rb +45 -0
- data/lib/apollo_commons_ruby/NetworkUtils.rb +67 -0
- data/lib/apollo_commons_ruby/Operation.rb +4 -0
- data/lib/apollo_commons_ruby/ResolveTemplate.rb +53 -0
- data/lib/apollo_commons_ruby/SecretConfig.rb +15 -0
- data/lib/apollo_commons_ruby/TemplateBuilder.rb +26 -0
- data/lib/apollo_commons_ruby/TemplatesHelper.rb +814 -0
- data/lib/apollo_commons_ruby/TemplatesRakefile.rb +816 -0
- data/lib/apollo_commons_ruby/ViewGroup.rb +62 -0
- data/lib/apollo_commons_ruby/ViewGroupComponent.rb +66 -0
- data/lib/apollo_commons_ruby/ViewGroupDefinition.rb +61 -0
- data/lib/tasks/add_translations.rake +9 -0
- data/lib/tasks/checkValidJson.rake +17 -0
- data/lib/tasks/delete_domain_event.rake +7 -0
- data/lib/tasks/delete_view_group.rake +7 -0
- data/lib/tasks/delete_view_group_component.rake +7 -0
- data/lib/tasks/delete_view_group_definition.rake +7 -0
- data/lib/tasks/deploy_all_templates.rake +7 -0
- data/lib/tasks/runTests.rake +27 -0
- data/lib/tasks/update_all.rake +36 -0
- data/lib/tasks/update_all_domain_events.rake +24 -0
- data/lib/tasks/update_all_view_group_components.rake +18 -0
- data/lib/tasks/update_domain_event.rake +11 -0
- data/lib/tasks/update_one_template.rake +42 -0
- data/lib/tasks/update_translations.rake +24 -0
- data/lib/tasks/update_view_group_component.rake +9 -0
- data/lib/tasks/update_view_group_definition.rake +7 -0
- data/lib/tasks/update_view_group_for_user_0.rake +36 -0
- data/lib/version.rb +3 -0
- metadata +91 -0
@@ -0,0 +1,62 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
require 'json'
|
3
|
+
require 'pp'
|
4
|
+
require_relative './NetworkUtils'
|
5
|
+
require_relative './FileUtils'
|
6
|
+
require_relative './Operation'
|
7
|
+
require_relative './SecretConfig'
|
8
|
+
|
9
|
+
$environmentProperties = nil
|
10
|
+
$operation = nil
|
11
|
+
$viewGroup = nil
|
12
|
+
$secretConfig = nil
|
13
|
+
|
14
|
+
class ViewGroup
|
15
|
+
attr_reader :tenantId
|
16
|
+
attr_reader :projectId
|
17
|
+
attr_reader :viewGroupDefinition
|
18
|
+
attr_reader :domainId
|
19
|
+
attr_reader :tenantUserId
|
20
|
+
attr_reader :viewGroupName
|
21
|
+
|
22
|
+
def initialize(configuration_json, view_group_definition, view_group_name, domain_id, tenant_user_id)
|
23
|
+
@tenantId = configuration_json["tenantId"]
|
24
|
+
@projectId = configuration_json["projectId"]
|
25
|
+
@viewGroupDefinition = view_group_definition
|
26
|
+
@viewGroupName = view_group_name
|
27
|
+
@domainId = domain_id
|
28
|
+
@tenantUserId = tenant_user_id
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def handle_view_group_task(env, operation)
|
33
|
+
viewGroupDefinitionName = env["view_group_definition"]
|
34
|
+
environment = env["environment"]
|
35
|
+
viewGroupName = env["view_group_name"]
|
36
|
+
domainId = env["domain"]
|
37
|
+
tenantUserId = env["tenant_user_id"]
|
38
|
+
tenantId = ENV["tenant_id"]
|
39
|
+
projectId = ENV["project_id"]
|
40
|
+
handle_view_group(viewGroupDefinitionName, environment, tenantId, projectId, viewGroupName, domainId, tenantUserId, operation)
|
41
|
+
end
|
42
|
+
|
43
|
+
def handle_view_group(viewGroupDefinitionName, environment, tenantId, projectId, viewGroupName, domainId, tenantUserId, operation)
|
44
|
+
$operation = operation
|
45
|
+
load_environment_properties(environment, tenantId, projectId)
|
46
|
+
prepare_view_group(viewGroupDefinitionName, viewGroupName, domainId, tenantUserId)
|
47
|
+
perform_view_group_operation
|
48
|
+
end
|
49
|
+
|
50
|
+
def prepare_view_group(viewGroupDefinitionName, viewGroupName, domainId, tenantUserId)
|
51
|
+
$viewGroup = ViewGroup.new($environmentProperties, viewGroupDefinitionName, viewGroupName, domainId, tenantUserId)
|
52
|
+
end
|
53
|
+
|
54
|
+
def perform_view_group_operation
|
55
|
+
baseMarioUrl = $environmentProperties["apolloMarioBaseUrl"]
|
56
|
+
authToken = $secretConfig.authToken
|
57
|
+
marioUrl = baseMarioUrl + "/apollo-mario/1.0/tenants/" + $viewGroup.tenantId + "/projects/" + $viewGroup.projectId + "/domains/" + $viewGroup.domainId + "/tenant-users/" + $viewGroup.tenantUserId + "/view-group-definitions/" + $viewGroup.viewGroupDefinition + "/view-groups/" + $viewGroup.viewGroupName
|
58
|
+
replace_environment_based_config_in_string(marioUrl, $environmentProperties)
|
59
|
+
if $operation == Operation::DELETE
|
60
|
+
make_DELETE_request(marioUrl, authToken)
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
require 'json'
|
3
|
+
require 'pp'
|
4
|
+
require_relative './NetworkUtils'
|
5
|
+
require_relative './FileUtils'
|
6
|
+
require_relative './Operation'
|
7
|
+
require_relative './SecretConfig'
|
8
|
+
|
9
|
+
$environmentProperties = nil
|
10
|
+
$operation = nil
|
11
|
+
$viewGroupComponent = nil
|
12
|
+
$secretConfig = nil
|
13
|
+
|
14
|
+
class ViewGroupComponent
|
15
|
+
attr_reader :tenantId
|
16
|
+
attr_reader :projectId
|
17
|
+
attr_reader :viewGroupDefinition
|
18
|
+
attr_reader :viewGroupComponent
|
19
|
+
attr_reader :requestBody
|
20
|
+
|
21
|
+
def initialize(configuration_json, view_group_definition, view_group_component)
|
22
|
+
@tenantId = configuration_json["tenantId"]
|
23
|
+
@projectId = configuration_json["projectId"]
|
24
|
+
@viewGroupDefinition = view_group_definition
|
25
|
+
@viewGroupComponent = view_group_component
|
26
|
+
view_group_component_properties = File.read("./configs/" + view_group_definition + "/" + view_group_component + "/view_group_component_properties.json")
|
27
|
+
@requestBody = JSON.parse view_group_component_properties
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def handle_view_group_component_task(env, operation)
|
32
|
+
viewGroupDefinitionName = env["view_group_definition"]
|
33
|
+
environment = env["environment"]
|
34
|
+
component = env["view_group_component"]
|
35
|
+
tenantId = ENV["tenant_id"]
|
36
|
+
projectId = ENV["project_id"]
|
37
|
+
handle_view_group_component(viewGroupDefinitionName, environment, tenantId, projectId, component, operation)
|
38
|
+
end
|
39
|
+
|
40
|
+
def handle_view_group_component(viewGroupDefinitionName, environment, tenantId, projectId, component, operation)
|
41
|
+
$operation = operation
|
42
|
+
load_environment_properties(environment, tenantId, projectId)
|
43
|
+
prepare_view_group_component(viewGroupDefinitionName, component)
|
44
|
+
perform_view_group_component_operation
|
45
|
+
end
|
46
|
+
|
47
|
+
def prepare_view_group_component(view_group_definition, component)
|
48
|
+
$viewGroupComponent = ViewGroupComponent.new($environmentProperties, view_group_definition, component)
|
49
|
+
end
|
50
|
+
|
51
|
+
def perform_view_group_component_operation
|
52
|
+
raise_exception_if_string_empty($viewGroupComponent.requestBody["templateGroup"], "templateGroup")
|
53
|
+
baseMarioUrl = $environmentProperties["apolloMarioBaseUrl"]
|
54
|
+
authToken = $secretConfig.authToken
|
55
|
+
marioUrl = baseMarioUrl + "/apollo-mario/1.0/tenants/" + $viewGroupComponent.tenantId + "/projects/" + $viewGroupComponent.projectId + "/view-group-definitions/" + $viewGroupComponent.viewGroupDefinition + "/components/" + $viewGroupComponent.viewGroupComponent
|
56
|
+
replace_environment_based_config_in_string(marioUrl, $environmentProperties)
|
57
|
+
if $operation == Operation::PUT
|
58
|
+
make_PUT_request(marioUrl,
|
59
|
+
replace_environment_based_config_in_string(JSON.generate($viewGroupComponent.requestBody), $environmentProperties),
|
60
|
+
authToken)
|
61
|
+
return
|
62
|
+
end
|
63
|
+
if $operation == Operation::DELETE
|
64
|
+
make_DELETE_request(marioUrl, authToken)
|
65
|
+
end
|
66
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
require 'json'
|
3
|
+
require 'pp'
|
4
|
+
require_relative './NetworkUtils'
|
5
|
+
require_relative './FileUtils'
|
6
|
+
require_relative './Operation'
|
7
|
+
require_relative './SecretConfig'
|
8
|
+
|
9
|
+
$environmentProperties = nil
|
10
|
+
$operation = nil
|
11
|
+
$viewGroupDefinition = nil
|
12
|
+
$secretConfig = nil
|
13
|
+
|
14
|
+
class ViewGroupDefinition
|
15
|
+
attr_reader :tenantId
|
16
|
+
attr_reader :projectId
|
17
|
+
attr_reader :viewGroupDefinition
|
18
|
+
attr_reader :requestBody
|
19
|
+
|
20
|
+
def initialize(configuration_json, view_group_definition)
|
21
|
+
@tenantId = configuration_json["tenantId"]
|
22
|
+
@projectId = configuration_json["projectId"]
|
23
|
+
@viewGroupDefinition = view_group_definition
|
24
|
+
view_group_definition_properties = File.read("./configs/" + view_group_definition + "/view_group_definition_properties.json")
|
25
|
+
@requestBody = JSON.parse view_group_definition_properties
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def handle_view_group_definition_task(env, operation)
|
30
|
+
viewGroupDefinitionName = env["view_group_definition"]
|
31
|
+
environment = env["environment"]
|
32
|
+
tenantId = ENV["tenant_id"]
|
33
|
+
projectId = ENV["project_id"]
|
34
|
+
handle_view_group_definition(viewGroupDefinitionName, environment, tenantId, projectId, operation)
|
35
|
+
end
|
36
|
+
|
37
|
+
def handle_view_group_definition(viewGroupDefinitionName, environment, tenantId, projectId, operation)
|
38
|
+
$operation = operation
|
39
|
+
load_environment_properties(environment, tenantId, projectId)
|
40
|
+
prepare_view_group_definition(viewGroupDefinitionName)
|
41
|
+
perform_view_group_definition_operation
|
42
|
+
end
|
43
|
+
|
44
|
+
def prepare_view_group_definition(view_group_definition)
|
45
|
+
$viewGroupDefinition = ViewGroupDefinition.new($environmentProperties, view_group_definition)
|
46
|
+
end
|
47
|
+
|
48
|
+
def perform_view_group_definition_operation
|
49
|
+
baseMarioUrl = $environmentProperties["apolloMarioBaseUrl"]
|
50
|
+
authToken = $secretConfig.authToken
|
51
|
+
|
52
|
+
marioUrl = baseMarioUrl + "/apollo-mario/1.0/tenants/" + $viewGroupDefinition.tenantId + "/projects/" + $viewGroupDefinition.projectId + "/view-group-definitions/" + $viewGroupDefinition.viewGroupDefinition
|
53
|
+
replace_environment_based_config_in_string(marioUrl, $environmentProperties)
|
54
|
+
if $operation == Operation::PUT
|
55
|
+
make_PUT_request(marioUrl, replace_environment_based_config_in_string(JSON.generate($viewGroupDefinition.requestBody), $environmentProperties), authToken)
|
56
|
+
return
|
57
|
+
end
|
58
|
+
if $operation == Operation::DELETE
|
59
|
+
make_DELETE_request(marioUrl, authToken)
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
require_relative '../apollo_commons_ruby/TemplatesRakefile'
|
2
|
+
require_relative '../apollo_commons_ruby/TemplatesHelper'
|
3
|
+
|
4
|
+
desc "Add translated language"
|
5
|
+
task :add_translations do
|
6
|
+
language = ENV["language"]
|
7
|
+
puts "Adding Translations for language #{language}"
|
8
|
+
add_translations_for_language(language)
|
9
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require_relative '../apollo_commons_ruby/TemplatesRakefile'
|
2
|
+
require_relative '../apollo_commons_ruby/TemplatesHelper'
|
3
|
+
|
4
|
+
desc "Check if all JSON files in the repo are valid"
|
5
|
+
task :checkValidJson do
|
6
|
+
require 'find'
|
7
|
+
Find.find(Dir.pwd) do |file|
|
8
|
+
# process
|
9
|
+
if (file.include? ".json" and file.include? "Templates/")
|
10
|
+
data = read_data_from_file_path(file)
|
11
|
+
puts file
|
12
|
+
if data.strip != ""
|
13
|
+
parsedData = JSON.parse(data)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require_relative '../apollo_commons_ruby/TemplatesRakefile'
|
2
|
+
require_relative '../apollo_commons_ruby/TemplatesHelper'
|
3
|
+
|
4
|
+
desc "Unit test"
|
5
|
+
task :runTests do
|
6
|
+
require 'find'
|
7
|
+
if !Dir.pwd.include? "/Users/ios-ci/.jenkins/jobs/"
|
8
|
+
puts "Make sure that you have NodeJS installed."
|
9
|
+
puts "Export the necessary functions. Eg: exports.functionName = functionName;"
|
10
|
+
puts "For running individual tests, use the command: node <filename>.js"
|
11
|
+
puts "Example: node AndroidCurrencyUtilsTest.js"
|
12
|
+
end
|
13
|
+
puts "\n"
|
14
|
+
puts "NodeJS version: "
|
15
|
+
system("node -v")
|
16
|
+
puts "\n"
|
17
|
+
Find.find(Dir.pwd + "/commons/tests/") do |file|
|
18
|
+
if (file.include? ".js" and !file.include? "TestUtils.js")
|
19
|
+
puts "Running tests from " + file.sub(Dir.pwd, '')
|
20
|
+
result = system("node " + file)
|
21
|
+
if (!result)
|
22
|
+
exec("exit 1")
|
23
|
+
end
|
24
|
+
puts "\n"
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require_relative '../apollo_commons_ruby/ViewGroupDefinition'
|
2
|
+
require_relative '../apollo_commons_ruby/ViewGroupComponent'
|
3
|
+
require_relative '../apollo_commons_ruby/DomainEvent'
|
4
|
+
require_relative '../apollo_commons_ruby/MarioEvent'
|
5
|
+
require_relative '../apollo_commons_ruby/Operation'
|
6
|
+
|
7
|
+
desc "Update all"
|
8
|
+
task :update_all do
|
9
|
+
environment = ENV["environment"]
|
10
|
+
tenantId = ENV["tenant_id"]
|
11
|
+
projectId = ENV["project_id"]
|
12
|
+
|
13
|
+
Dir.foreach('./configs') do |viewGroupDefinition|
|
14
|
+
next if viewGroupDefinition == '.' || viewGroupDefinition == '..' || viewGroupDefinition == '.DS_Store' || viewGroupDefinition.start_with?('0_') == true
|
15
|
+
|
16
|
+
puts "Updating definition " + viewGroupDefinition
|
17
|
+
handle_view_group_definition(viewGroupDefinition, environment, tenantId, projectId, Operation::PUT)
|
18
|
+
|
19
|
+
Dir.foreach('./configs/' + viewGroupDefinition) do |viewGroupComponent|
|
20
|
+
next if viewGroupComponent == '.' || viewGroupComponent == '..' || viewGroupComponent == 'view_group_definition_properties.json'
|
21
|
+
|
22
|
+
puts "Updating component " + viewGroupComponent
|
23
|
+
handle_view_group_component(viewGroupDefinition, environment, tenantId, projectId, viewGroupComponent, Operation::PUT)
|
24
|
+
|
25
|
+
Dir.foreach('./configs/' + viewGroupDefinition + "/" + viewGroupComponent) do |topic|
|
26
|
+
next if topic == '.' || topic == '..' || topic == 'view_group_component_properties.json'
|
27
|
+
|
28
|
+
Dir.foreach('./configs/' + viewGroupDefinition + "/" + viewGroupComponent + "/" + topic) do |eventName|
|
29
|
+
next if eventName == '.' || eventName == '..'
|
30
|
+
puts "Updating domain event for topic " + topic + " and eventName = " + eventName
|
31
|
+
handle_domain_event(viewGroupDefinition, environment, tenantId, projectId, viewGroupComponent, topic, eventName, Operation::PUT)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require_relative '../apollo_commons_ruby/ViewGroupDefinition'
|
2
|
+
require_relative '../apollo_commons_ruby/ViewGroupComponent'
|
3
|
+
require_relative '../apollo_commons_ruby/DomainEvent'
|
4
|
+
require_relative '../apollo_commons_ruby/Operation'
|
5
|
+
|
6
|
+
desc "Update all Domain Events"
|
7
|
+
task :update_all_domain_events do
|
8
|
+
handle_view_group_definition_task(ENV, Operation::PUT)
|
9
|
+
handle_view_group_component_task(ENV, Operation::PUT)
|
10
|
+
viewGroupDefinition = ENV["view_group_definition"]
|
11
|
+
viewGroupComponent = ENV["view_group_component"]
|
12
|
+
environment = ENV["environment"]
|
13
|
+
tenantId = ENV["tenant_id"]
|
14
|
+
projectId = ENV["project_id"]
|
15
|
+
|
16
|
+
Dir.foreach('./configs/' + viewGroupDefinition + "/" + viewGroupComponent) do |topic|
|
17
|
+
next if topic == '.' || topic == '..' || topic == 'view_group_component_properties.json'
|
18
|
+
Dir.foreach('./configs/' + viewGroupDefinition + "/" + viewGroupComponent + "/" + topic) do |eventName|
|
19
|
+
next if eventName == '.' || eventName == '..'
|
20
|
+
puts "Updating domain event for topic " + topic + " and eventName = " + eventName
|
21
|
+
handle_domain_event(viewGroupDefinition, environment, tenantId, projectId, viewGroupComponent, topic, eventName, Operation::PUT)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require_relative '../apollo_commons_ruby/ViewGroupDefinition'
|
2
|
+
require_relative '../apollo_commons_ruby/ViewGroupComponent'
|
3
|
+
require_relative '../apollo_commons_ruby/Operation'
|
4
|
+
|
5
|
+
desc "Update all View Group Components"
|
6
|
+
task :update_all_view_group_components do
|
7
|
+
handle_view_group_definition_task(ENV, Operation::PUT)
|
8
|
+
viewGroupDefinition = ENV["view_group_definition"]
|
9
|
+
environment = ENV["environment"]
|
10
|
+
tenantId = ENV["tenant_id"]
|
11
|
+
projectId = ENV["project_id"]
|
12
|
+
|
13
|
+
Dir.foreach('./configs/' + viewGroupDefinition) do |component|
|
14
|
+
next if component == '.' || component == '..' || component == 'view_group_definition_properties.json'
|
15
|
+
puts "Updating component " + component
|
16
|
+
handle_view_group_component(viewGroupDefinition, environment, tenantId, projectId, component, Operation::PUT)
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require_relative '../apollo_commons_ruby/ViewGroupDefinition'
|
2
|
+
require_relative '../apollo_commons_ruby/ViewGroupComponent'
|
3
|
+
require_relative '../apollo_commons_ruby/DomainEvent'
|
4
|
+
require_relative '../apollo_commons_ruby/Operation'
|
5
|
+
|
6
|
+
desc "Update Domain Event"
|
7
|
+
task :update_domain_event do
|
8
|
+
handle_view_group_definition_task(ENV, Operation::PUT)
|
9
|
+
handle_view_group_component_task(ENV, Operation::PUT)
|
10
|
+
handle_domain_event_task(ENV, Operation::PUT)
|
11
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require_relative '../apollo_commons_ruby/TemplatesRakefile'
|
2
|
+
require_relative '../apollo_commons_ruby/TemplatesHelper'
|
3
|
+
|
4
|
+
desc "Update given template name to Inbox/Apollo-config"
|
5
|
+
task :update_one_template do
|
6
|
+
task_to_schedule = OpenStruct.new
|
7
|
+
task_to_schedule.environment = ENV['environment']
|
8
|
+
task_to_schedule.template_group = ENV['template_group']
|
9
|
+
task_to_schedule.language = ENV['language']
|
10
|
+
task_to_schedule.view_type = ENV['view_type']
|
11
|
+
task_to_schedule.template_name = ENV['template_name']
|
12
|
+
task_to_schedule.version = ENV['version']
|
13
|
+
task_to_schedule.tenant_id = ENV['tenant_id']
|
14
|
+
task_to_schedule.project_id = ENV['project_id']
|
15
|
+
if ENV['should_update_inbox'] == 'true'
|
16
|
+
task_to_schedule.should_update_inbox = true
|
17
|
+
else
|
18
|
+
task_to_schedule.should_update_inbox = false
|
19
|
+
end
|
20
|
+
if ENV['scope_id'] === nil
|
21
|
+
raise "scope_id is mandatory for deploying templates."
|
22
|
+
end
|
23
|
+
task_to_schedule.scope_id = ENV['scope_id']
|
24
|
+
task_to_schedule.task_id = 1
|
25
|
+
|
26
|
+
# current_dir = Dir.pwd
|
27
|
+
# if !current_dir.include? "/Users/ios-ci/.jenkins/jobs/"
|
28
|
+
# puts "This rake command is no more supported. Please use jenkins build http://iosci.corp.zeta.in:8080/job/"
|
29
|
+
# return nil
|
30
|
+
# end
|
31
|
+
|
32
|
+
if task_to_schedule.environment == nil or task_to_schedule.template_group == nil
|
33
|
+
puts "`environment`, `template_group` has to be passed. Environment = `Prod`/'PreProd'/`Staging`"
|
34
|
+
return
|
35
|
+
end
|
36
|
+
|
37
|
+
if task_to_schedule.environment.eql?("Prod")
|
38
|
+
#perform_git_checks
|
39
|
+
end
|
40
|
+
|
41
|
+
deploy_one_template(task_to_schedule)
|
42
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require_relative '../apollo_commons_ruby/TemplatesRakefile'
|
2
|
+
require_relative '../apollo_commons_ruby/TemplatesHelper'
|
3
|
+
|
4
|
+
desc "Replace translation strings in an existing resource file from new provided translations"
|
5
|
+
task :update_translations do
|
6
|
+
# Expectations:
|
7
|
+
# 1) Source file should have traslated strings in key,translated_string format per line
|
8
|
+
# 2) Destination will be always be one of the languages added to Resources folder previously
|
9
|
+
source_csv_file_path = ENV['source_csv']
|
10
|
+
language = ENV['language']
|
11
|
+
if source_csv_file_path == nil
|
12
|
+
log_error("source_csv has to be passed.")
|
13
|
+
abort()
|
14
|
+
end
|
15
|
+
|
16
|
+
if language == nil
|
17
|
+
log_error("language has to be passed.")
|
18
|
+
abort()
|
19
|
+
end
|
20
|
+
|
21
|
+
language_file_path = "Resources/#{language}.json"
|
22
|
+
update_existing_translations(source_csv_file_path, language_file_path)
|
23
|
+
|
24
|
+
end
|