From 4c8fe4a76f4a83f000348fe27df967f6f74c7a89 Mon Sep 17 00:00:00 2001 From: Dave Cassel Date: Wed, 27 Apr 2016 17:26:36 -0400 Subject: [PATCH] #415 adding "deploy rest config" command --- deploy/lib/Help.rb | 15 +++++++++------ deploy/lib/ml_rest.rb | 1 + deploy/lib/server_config.rb | 8 +++++--- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/deploy/lib/Help.rb b/deploy/lib/Help.rb index f97c3570..9e698a64 100644 --- a/deploy/lib/Help.rb +++ b/deploy/lib/Help.rb @@ -276,12 +276,15 @@ def self.deploy schemas # deploys schemas to your schemas db in the given environment cpf # deploys your cpf config to the server in the given environment src # deploys the src code to your modules db in the given environment - rest # deploys properties, extensions, and transforms to our modules db in the given environment - ext # deploys your rest extensions to the server in the given environment - if a name is specified, then only that extension will be deployed - transform # deploys your rest extensions to the server in the given environment - if a name is specified, then only that transform will be deployed - triggers # deploys triggers from deploy/triggers-config.xml to your triggers database + rest # deploys properties, search options, extensions, and transforms + to our modules db in the given environment + rest-config # deploys properties and search options to our modules db + ext # deploys rest extensions to the server in the given environment + if a name is specified, only that extension will be deployed + transform # deploys rest transforms to the server in the given environment + if a name is specified, only that transform will be deployed + triggers # deploys triggers from deploy/triggers-config.xml to your + triggers database DOC end diff --git a/deploy/lib/ml_rest.rb b/deploy/lib/ml_rest.rb index 9a161df5..e5dfa2b8 100644 --- a/deploy/lib/ml_rest.rb +++ b/deploy/lib/ml_rest.rb @@ -38,6 +38,7 @@ def get_files(path, data = []) end def install_properties(path) + @logger.info("Loading REST properties in #{path}") if (File.exists?(path)) headers = { 'Content-Type' => 'application/xml' diff --git a/deploy/lib/server_config.rb b/deploy/lib/server_config.rb index 09d8b860..bf6fb2d6 100644 --- a/deploy/lib/server_config.rb +++ b/deploy/lib/server_config.rb @@ -939,6 +939,8 @@ def deploy deploy_cpf when 'triggers' deploy_triggers + when 'rest-config' + deploy_rest_config else raise HelpException.new("deploy", "Invalid WHAT") end @@ -1739,7 +1741,7 @@ def deploy_src def deploy_rest # Deploy options, extensions to the REST API server if ['rest', 'hybrid'].include? @properties["ml.app-type"] - # Figure out where we need to deploy this stuff + # Verify that we're not trying to run REST from the filesystem rest_modules_db = '' if @properties.has_key?('ml.rest-port') and @properties['ml.rest-port'] != '' rest_modules_db = conditional_prop('ml.rest-modules-db', 'ml.modules-db') @@ -1752,13 +1754,13 @@ def deploy_rest return end - deploy_rest_config(rest_modules_db) + deploy_rest_config() deploy_ext() deploy_transform() end end - def deploy_rest_config (rest_modules_db) + def deploy_rest_config () if (@properties.has_key?('ml.rest-options.dir') && File.exist?(@properties['ml.rest-options.dir'])) prop_path = "#{@properties['ml.rest-options.dir']}/properties.xml"