Class: Fastlane::Actions::UploadSnapshotAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::UploadSnapshotAction
- Defined in:
- lib/fastlane/plugin/snapshot_test/actions/regression/upload_snapshot.rb
Class Method Summary collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .details ⇒ Object
- .example_code ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .run(params) ⇒ Object
Class Method Details
.authors ⇒ Object
54 55 56 |
# File 'lib/fastlane/plugin/snapshot_test/actions/regression/upload_snapshot.rb', line 54 def self. ["MoyuruAizawa"] end |
.available_options ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/fastlane/plugin/snapshot_test/actions/regression/upload_snapshot.rb', line 29 def self. [ FastlaneCore::ConfigItem.new(key: :gcloud_service_key_file, env_name: "GCLOUD_SERVICE_KEY_FILE", description: "File path containing the gcloud auth key. Default: Created from GCLOUD_SERVICE_KEY environment variable", type: String, optional: false), FastlaneCore::ConfigItem.new(key: :snapshot_bucket, env_name: "SNAPSHOT_BUCKET", description: "GCS Bucket that stores expected images", type: String, optional: false), FastlaneCore::ConfigItem.new(key: :working_dir, env_name: "WORKING_DIR", description: "Working directory", type: String, optional: false), FastlaneCore::ConfigItem.new(key: :screenshot_dir, env_name: "SCREENSHOT_DIR", description: "Working directory", type: String, optional: false) ] end |
.description ⇒ Object
21 22 23 |
# File 'lib/fastlane/plugin/snapshot_test/actions/regression/upload_snapshot.rb', line 21 def self.description "Upload Snapshot" end |
.details ⇒ Object
25 26 27 |
# File 'lib/fastlane/plugin/snapshot_test/actions/regression/upload_snapshot.rb', line 25 def self.details "Upload Snapshot" end |
.example_code ⇒ Object
62 63 64 65 66 67 68 69 |
# File 'lib/fastlane/plugin/snapshot_test/actions/regression/upload_snapshot.rb', line 62 def self.example_code ['upload_snapshot( gcloud_service_key_file: "fastlane/client-secret.json", snapshot_bucket: "cats-android-snapshot", working_dir: ".snapshot_test", screenshot_dir: ".screenshot/shamu-22-ja_JP-portrait" )'] end |
.is_supported?(platform) ⇒ Boolean
58 59 60 |
# File 'lib/fastlane/plugin/snapshot_test/actions/regression/upload_snapshot.rb', line 58 def self.is_supported?(platform) true end |
.run(params) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/fastlane/plugin/snapshot_test/actions/regression/upload_snapshot.rb', line 8 def self.run(params) Helper.authenticate(params[:gcloud_service_key_file]) UI. "Copy screenshots to working directory" working_dir = params[:working_dir] screenshot_dir = params[:screenshot_dir] `mkdir #{working_dir}` `rm -rf #{working_dir}/actual` `mkdir #{working_dir}/actual` Action.sh "cp -pR #{screenshot_dir}/* #{working_dir}/actual" Action.sh "gsutil -m rsync -d -r #{working_dir} gs://#{params[:snapshot_bucket]}/#{Helper.get_current_commit_hash}" end |