From e9c406a00a2a8c0d6f5daa9341defbb80d5b4055 Mon Sep 17 00:00:00 2001 From: Axel Schlueter Date: Mon, 15 May 2017 16:25:27 +0200 Subject: [PATCH] option to move the generated HTML file into the version directory (issue #29) --- .../plugin/aws_s3/actions/aws_s3_action.rb | 30 ++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/lib/fastlane/plugin/aws_s3/actions/aws_s3_action.rb b/lib/fastlane/plugin/aws_s3/actions/aws_s3_action.rb index d0aa195..809bdb2 100644 --- a/lib/fastlane/plugin/aws_s3/actions/aws_s3_action.rb +++ b/lib/fastlane/plugin/aws_s3/actions/aws_s3_action.rb @@ -38,6 +38,7 @@ def self.run(config) params[:html_template_path] = config[:html_template_path] params[:html_file_name] = config[:html_file_name] params[:skip_html_upload] = config[:skip_html_upload] + params[:html_in_folder] = config[:html_in_folder] params[:version_template_path] = config[:version_template_path] params[:version_file_name] = config[:version_file_name] @@ -87,6 +88,7 @@ def self.upload_ipa(s3_client, params, s3_region, s3_access_key, s3_secret_acces plist_file_name = params[:plist_file_name] html_template_path = params[:html_template_path] html_file_name = params[:html_file_name] + generate_html_in_folder = params[:html_in_folder] version_template_path = params[:version_template_path] version_file_name = params[:version_file_name] @@ -202,9 +204,9 @@ def self.upload_ipa(s3_client, params, s3_region, s3_access_key, s3_secret_acces # html uploading # ##################################### - + skip_html = params[:skip_html_upload] - + html_file_name = "#{url_part}#{html_file_name}" if generate_html_in_folder html_url = self.upload_file(s3_client, s3_bucket, app_directory, html_file_name, html_render, acl) unless skip_html version_url = self.upload_file(s3_client, s3_bucket, app_directory, version_file_name, version_render, acl) @@ -217,7 +219,7 @@ def self.upload_ipa(s3_client, params, s3_region, s3_access_key, s3_secret_acces Actions.lane_context[SharedValues::S3_VERSION_OUTPUT_PATH] = version_url ENV[SharedValues::S3_VERSION_OUTPUT_PATH.to_s] = version_url - + self.upload_source(s3_client, params, s3_bucket, params[:source], s3_path, acl) UI.success("Successfully uploaded ipa file to '#{Actions.lane_context[SharedValues::S3_IPA_OUTPUT_PATH]}'") @@ -300,7 +302,7 @@ def self.upload_apk(s3_client, params, s3_region, s3_access_key, s3_secret_acces # html and plist uploading # ##################################### - + skip_html = params[:skip_html_upload] html_url = self.upload_file(s3_client, s3_bucket, app_directory, html_file_name, html_render, acl) unless skip_html @@ -313,32 +315,32 @@ def self.upload_apk(s3_client, params, s3_region, s3_access_key, s3_secret_acces ENV[SharedValues::S3_VERSION_OUTPUT_PATH.to_s] = version_url self.upload_source(s3_client, params, s3_bucket, params[:source], s3_path, acl) - + UI.success("Successfully uploaded apk file to '#{Actions.lane_context[SharedValues::S3_APK_OUTPUT_PATH]}'") UI.success("Android app can be downloaded at '#{Actions.lane_context[SharedValues::S3_HTML_OUTPUT_PATH]}'") unless skip_html end - + def self.upload_source(s3_client, params, s3_bucket, source_directory, s3_path, acl) if source_directory && File.directory?(source_directory) source_directory = File.absolute_path source_directory output_file_path = Tempfile.new('aws_s3_source').path - + output_file_path = other_action.zip( path: source_directory, output_path: output_file_path.gsub(/(?