Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Commit

Permalink
Merge pull request #605 from dmcassel/issue-415
Browse files Browse the repository at this point in the history
#415 adding "deploy rest config" command
  • Loading branch information
grtjn authored Jun 20, 2016
2 parents d10c56c + 4c8fe4a commit bd1e1bf
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
15 changes: 9 additions & 6 deletions deploy/lib/Help.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions deploy/lib/ml_rest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
8 changes: 5 additions & 3 deletions deploy/lib/server_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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')
Expand All @@ -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"
Expand Down

0 comments on commit bd1e1bf

Please sign in to comment.