Class: Fastlane::Actions::S3Action

Inherits:
Fastlane::Action show all
Defined in:
fastlane/lib/fastlane/actions/s3.rb

Constant Summary

Constants inherited from Fastlane::Action

Fastlane::Action::AVAILABLE_CATEGORIES, Fastlane::Action::RETURN_TYPES

Class Method Summary collapse

Methods inherited from Fastlane::Action

action_name, authors, lane_context, method_missing, other_action, return_type, return_value, sample_return_value, shell_out_should_use_bundle_exec?, step_text

Class Method Details

.authorObject



135
136
137
# File 'fastlane/lib/fastlane/actions/s3.rb', line 135

def self.author
  "joshdholtz"
end

.available_optionsObject



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'fastlane/lib/fastlane/actions/s3.rb', line 36

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :ipa,
                                 env_name: "",
                                 description: ".ipa file for the build ",
                                 optional: true,
                                 default_value: Actions.lane_context[SharedValues::IPA_OUTPUT_PATH],
                                 default_value_dynamic: true),
    FastlaneCore::ConfigItem.new(key: :dsym,
                                 env_name: "",
                                 description: "zipped .dsym package for the build ",
                                 optional: true,
                                 default_value: Actions.lane_context[SharedValues::DSYM_OUTPUT_PATH],
                                 default_value_dynamic: true),
    FastlaneCore::ConfigItem.new(key: :upload_metadata,
                                 env_name: "",
                                 description: "Upload relevant metadata for this build",
                                 optional: true,
                                 default_value: true,
                                 type: Boolean),
    FastlaneCore::ConfigItem.new(key: :plist_template_path,
                                 env_name: "",
                                 description: "plist template path",
                                 optional: true),
    FastlaneCore::ConfigItem.new(key: :plist_file_name,
                                 env_name: "",
                                 description: "uploaded plist filename",
                                 optional: true),
    FastlaneCore::ConfigItem.new(key: :html_template_path,
                                 env_name: "",
                                 description: "html erb template path",
                                 optional: true),
    FastlaneCore::ConfigItem.new(key: :html_file_name,
                                 env_name: "",
                                 description: "uploaded html filename",
                                 optional: true),
    FastlaneCore::ConfigItem.new(key: :version_template_path,
                                 env_name: "",
                                 description: "version erb template path",
                                 optional: true),
    FastlaneCore::ConfigItem.new(key: :version_file_name,
                                 env_name: "",
                                 description: "uploaded version filename",
                                 optional: true),
    FastlaneCore::ConfigItem.new(key: :access_key,
                                 env_name: "S3_ACCESS_KEY",
                                 description: "AWS Access Key ID ",
                                 sensitive: true,
                                 optional: true,
                                 default_value: ENV['AWS_ACCESS_KEY_ID'],
                                 default_value_dynamic: true),
    FastlaneCore::ConfigItem.new(key: :secret_access_key,
                                 env_name: "S3_SECRET_ACCESS_KEY",
                                 description: "AWS Secret Access Key ",
                                 sensitive: true,
                                 optional: true,
                                 default_value: ENV['AWS_SECRET_ACCESS_KEY'],
                                 default_value_dynamic: true),
    FastlaneCore::ConfigItem.new(key: :bucket,
                                 env_name: "S3_BUCKET",
                                 description: "AWS bucket name",
                                 optional: true,
                                 code_gen_sensitive: true,
                                 default_value: ENV['AWS_BUCKET_NAME'],
                                 default_value_dynamic: true),
    FastlaneCore::ConfigItem.new(key: :region,
                                 env_name: "S3_REGION",
                                 description: "AWS region (for bucket creation) ",
                                 optional: true,
                                 code_gen_sensitive: true,
                                 default_value: ENV['AWS_REGION'],
                                 default_value_dynamic: true),
    FastlaneCore::ConfigItem.new(key: :path,
                                 env_name: "S3_PATH",
                                 description: "S3 'path'. Values from Info.plist will be substituted for keys wrapped in {}  ",
                                 optional: true,
                                 default_value: 'v{CFBundleShortVersionString}_b{CFBundleVersion}/'),
    FastlaneCore::ConfigItem.new(key: :source,
                                 env_name: "S3_SOURCE",
                                 description: "Optional source directory e.g. ./build ",
                                 optional: true),
    FastlaneCore::ConfigItem.new(key: :acl,
                                 env_name: "S3_ACL",
                                 description: "Uploaded object permissions e.g public_read (default), private, public_read_write, authenticated_read ",
                                 optional: true,
                                 default_value: "public_read")
  ]
end

.categoryObject



161
162
163
# File 'fastlane/lib/fastlane/actions/s3.rb', line 161

def self.category
  :deprecated
end

.deprecated_notesObject



165
166
167
168
169
170
# File 'fastlane/lib/fastlane/actions/s3.rb', line 165

def self.deprecated_notes
  [
    "Please use the `aws_s3` plugin instead.",
    "Install using `fastlane add_plugin aws_s3`."
  ].join("\n")
end

.descriptionObject



24
25
26
# File 'fastlane/lib/fastlane/actions/s3.rb', line 24

def self.description
  "Generates a plist file and uploads all to AWS S3"
end

.detailsObject



28
29
30
31
32
33
34
# File 'fastlane/lib/fastlane/actions/s3.rb', line 28

def self.details
  [
    "Upload a new build to Amazon S3 to distribute the build to beta testers.",
    "Works for both Ad Hoc and Enterprise signed applications. This step will generate the necessary HTML, plist, and version files for you.",
    "It is recommended to **not** store the AWS access keys in the `Fastfile`. The uploaded `version.json` file provides an easy way for apps to poll if a new update is available."
  ].join("\n")
end

.example_codeObject



143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# File 'fastlane/lib/fastlane/actions/s3.rb', line 143

def self.example_code
  [
    's3',
    's3(
      # All of these are used to make Shenzhen\'s `ipa distribute:s3` command
      access_key: ENV["S3_ACCESS_KEY"],               # Required from user.
      secret_access_key: ENV["S3_SECRET_ACCESS_KEY"], # Required from user.
      bucket: ENV["S3_BUCKET"],                       # Required from user.
      ipa: "AppName.ipa",                             # Optional if you use `ipa` to build
      dsym: "AppName.app.dSYM.zip",                   # Optional if you use `ipa` to build
      path: "v{CFBundleShortVersionString}_b{CFBundleVersion}/", # This is actually the default.
      upload_metadata: true,                          # Upload version.json, plist and HTML. Set to false to skip uploading of these files.
      version_file_name: "app_version.json",          # Name of the file to upload to S3. Defaults to "version.json"
      version_template_path: "path/to/erb"            # Path to an ERB to configure the structure of the version JSON file
    )'
  ]
end

.is_supported?(platform) ⇒ Boolean

Returns:



139
140
141
# File 'fastlane/lib/fastlane/actions/s3.rb', line 139

def self.is_supported?(platform)
  false
end

.outputObject



125
126
127
128
129
130
131
132
133
# File 'fastlane/lib/fastlane/actions/s3.rb', line 125

def self.output
  [
    ['S3_IPA_OUTPUT_PATH', 'Direct HTTP link to the uploaded ipa file'],
    ['S3_DSYM_OUTPUT_PATH', 'Direct HTTP link to the uploaded dsym file'],
    ['S3_PLIST_OUTPUT_PATH', 'Direct HTTP link to the uploaded plist file'],
    ['S3_HTML_OUTPUT_PATH', 'Direct HTTP link to the uploaded HTML file'],
    ['S3_VERSION_OUTPUT_PATH', 'Direct HTTP link to the uploaded Version file']
  ]
end

.run(config) ⇒ Object



20
21
22
# File 'fastlane/lib/fastlane/actions/s3.rb', line 20

def self.run(config)
  UI.user_error!("Please use the `aws_s3` plugin instead. Install using `fastlane add_plugin aws_s3`.")
end