问题
I have been using fastlane for uploading app to hockey and testflight.
I wanna use for S3 also and checking their document. I only have limited knowledge in S3.
https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Actions.md
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 is you use `ipa` to build
dsym: 'AppName.app.dSYM.zip', # Optional is 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
)
If I need to upload to /Main/bin/Dev, my bucket will be Main. But where and how can I describe my path ? Is it here (path:) ?
They say that
It is recommended to not store the AWS access keys in the Fastfile.
If so, where can I put AWS access key? It will still be in one of the text file and will commit to svn or git.
回答1:
The idea is to store it in an environment variable, usually people use .env for that. Make sure to not commit the . file in version control.
回答2:
The great thing about fastlane is that you can always drop down to the shell to use the aws s3 command line tools to upload as well. It also eliminates the need to provide all of the listed parameters in the fast lane s3 method.
sh "aws s3 cp path_to_ipa path_in_s3_where you want to store"
This is much easier and much more flexible. This would be called after gym is completed and you have an ipa to upload.
来源:https://stackoverflow.com/questions/39157644/uploading-to-s3-with-fastlane