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

Commit

Permalink
Fix custom username and password selection for edge case. Add support…
Browse files Browse the repository at this point in the history
… for mlcp and corb user properly
  • Loading branch information
RobertSzkutak committed Aug 20, 2016
1 parent 3ce79f1 commit 40e3825
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 7 deletions.
12 changes: 11 additions & 1 deletion deploy/default.properties
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,23 @@ password=admin
# bootstrap-user=
# bootstrap-password=


#
# Username/password used for deployment operations if specified
#
# deploy-user=
# deploy-password=

#
# Username/password used for mlcp if specified
#
# mlcp-user=
# mlcp-password=

#
# Username/password used for corb if specified
#
# corb-user=
# corb-password=

#
# Your Application's name
Expand Down
44 changes: 38 additions & 6 deletions deploy/lib/server_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,11 @@ def execute_query(query, properties = {})

def restart
@ml_username = @properties['ml.bootstrap-user'] || @properties['ml.user']
@ml_password = @properties['ml.bootstrap-password'] || @properties['ml.password']
if @ml_username == @properties['ml.bootstrap-user']
@ml_password = @properties['ml.bootstrap-password']
else
@ml_password = @properties['ml.password']
end

group = nil
ARGV.each do |arg|
Expand Down Expand Up @@ -635,7 +639,11 @@ def bootstrap
raise ExitException.new("Bootstrap requires the target environment's hostname to be defined") unless @hostname.present?

@ml_username = @properties['ml.bootstrap-user'] || @properties['ml.user']
@ml_password = @properties['ml.bootstrap-password'] || @properties['ml.password']
if @ml_username == @properties['ml.bootstrap-user']
@ml_password = @properties['ml.bootstrap-password']
else
@ml_password = @properties['ml.password']
end

internals = find_arg(['--replicate-internals'])
if internals
Expand Down Expand Up @@ -736,7 +744,11 @@ def bootstrap
def wipe

@ml_username = @properties['ml.bootstrap-user'] || @properties['ml.user']
@ml_password = @properties['ml.bootstrap-password'] || @properties['ml.password']
if @ml_username == @properties['ml.bootstrap-user']
@ml_password = @properties['ml.bootstrap-password']
else
@ml_password = @properties['ml.password']
end

if @environment != "local"
expected_response = %Q{I WANT TO WIPE #{@environment.upcase}}
Expand Down Expand Up @@ -928,7 +940,11 @@ def validate_install

def deploy
@ml_username = @properties['ml.deploy-user'] || @properties['ml.user']
@ml_password = @properties['ml.deploy-password'] || @properties['ml.password']
if @ml_username == @properties['ml.deploy-user']
@ml_password = @properties['ml.deploy-password']
else
@ml_password = @properties['ml.password']
end

what = ARGV.shift
raise HelpException.new("deploy", "Missing WHAT") unless what
Expand Down Expand Up @@ -1148,6 +1164,13 @@ def xqsync
end

def corb
@ml_username = @properties['ml.corb-user'] || @properties['ml.user']
if @ml_username == @properties['ml.corb-user']
@ml_password = @properties['ml.corb-password']
else
@ml_password = @properties['ml.password']
end

password_prompt
encoded_password = url_encode(@ml_password)
connection_string = %Q{xcc://#{@properties['ml.user']}:#{encoded_password}@#{@properties['ml.server']}:#{@properties['ml.xcc-port']}/#{@properties['ml.content-db']}}
Expand Down Expand Up @@ -1239,7 +1262,12 @@ def mlcp
end

@ml_username = @properties['ml.mlcp-user'] || @properties['ml.user']
@ml_password = @properties['ml.mlcp-password'] || @ml_password
if @ml_username == @properties['ml.mlcp-user']
@ml_password = @properties['ml.mlcp-password']
else
@ml_password = @properties['ml.password']
end

if ARGV.length > 0
password_prompt
connection_string = %Q{ -username #{@ml_username} -password #{@ml_password} -host #{@properties['ml.server']} -port #{@properties['ml.xcc-port']}}
Expand Down Expand Up @@ -1413,7 +1441,11 @@ def settings

def deploy_triggers
@ml_username = @properties['ml.deploy-user'] || @properties['ml.user']
@ml_password = @properties['ml.deploy-password'] || @properties['ml.password']
if @ml_username == @properties['ml.deploy-user']
@ml_password = @properties['ml.deploy-password']
else
@ml_password = @properties['ml.password']
end

logger.info "Deploying Triggers"
if !@properties["ml.triggers-db"]
Expand Down

0 comments on commit 40e3825

Please sign in to comment.