Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update logging for debugMode flag #49

Merged
merged 1 commit into from
Jun 3, 2024
Merged
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
10 changes: 7 additions & 3 deletions lib/fastlane/plugin/dynatrace/actions/dynatrace_action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ def self.run(params)
command << "#{dtxDssClientPath}"
command << "-#{params[:action]}" #"-upload"
command << "appid=\"#{params[:appId]}\""
command << "apitoken=\"#{params[:apitoken]}\""
command << "os=#{params[:os]}"
command << "bundleId=\"#{bundleId}\""
command << "versionStr=\"#{params[:versionStr]}\""
Expand All @@ -98,12 +97,17 @@ def self.run(params)
command << "forced=1" # if the file already exists
command << "tempdir=\"#{params[:tempdir]}\"" if params[:tempdir]

print_command = command

command << "apitoken=\"#{params[:apitoken]}\""
print_command << "apitoken=\"#{params[:apitoken]}\"" if params[:debugMode] == true

# Create the full shell command to trigger the DTXDssClient
shell_command = command.join(' ')

UI.message "#{shell_command}"
UI.message "#{print_command}"

sh("#{shell_command}", error_callback: ->(result) {
Fastlane::Actions.sh("#{shell_command}", log: params[:debugMode] == true, error_callback: ->(result) {
# ShAction doesn't return any reference to the return value -> parse it from the output
result_groups = result.match /(?:ERROR: Execution failed, rc=)(-?\d*)(?:\sreason=)(.*)/
if result_groups and result_groups.length() >= 2
Expand Down