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

Support different user credentials for different Roxy operations - #438 #602

Merged
merged 3 commits into from
Aug 22, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion deploy/default.properties
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,35 @@ schemas.dir=${basedir}/schemas
schemas.root=/

#
# Admin username/password that will exist on the local/dev/prod servers
# Default username/password that will exist on the local/dev/prod servers
#
user=admin
password=admin

#
# Username/password used for bootstrap, wipe and restart operations if specified
#
# 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
50 changes: 49 additions & 1 deletion deploy/lib/server_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,13 @@ def execute_query(query, properties = {})
end

def restart
@ml_username = @properties['ml.bootstrap-user'] || @properties['ml.user']
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|
# Exclude any argument passed from command line.
Expand Down Expand Up @@ -631,6 +638,13 @@ def config
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']
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 @@ -728,6 +742,14 @@ def bootstrap
end

def wipe

@ml_username = @properties['ml.bootstrap-user'] || @properties['ml.user']
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}}
print %Q{
Expand Down Expand Up @@ -917,6 +939,13 @@ def validate_install
alias_method :validate, :validate_install

def deploy
@ml_username = @properties['ml.deploy-user'] || @properties['ml.user']
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 @@ -1135,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 @@ -1226,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 @@ -1399,6 +1440,13 @@ def settings
end

def deploy_triggers
@ml_username = @properties['ml.deploy-user'] || @properties['ml.user']
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"]
raise ExitException.new("Deploy triggers requires a triggers database")
Expand Down