Loading...
Home
  • Tech Blogs
  • Videos
  • Conferences
    • Droidcon News
    • Upcoming Conferences
    • Become a Partner
    • Past Events
    • Keep Me Informed
    • Diversity Scholarships
  • Community
    • droidcon Team
    • How to Hold a Droidcon
  • Android Careers
Sign In

Global CSS

 

Upload files to Amazon S3 with Bitrise in a few steps

 

 
Vladimir Petrovski
Android Engineer @Beat 👹‍đŸ’»đŸŽ‰đŸŒ
Published: March 04, 2021
Tweet
Share
 
 

Photo by Christian Wiediger on Unsplash

 

Can we upload our APKs to AWS S3? Sometimes some files need to be uploaded to S3 rather than Bitrise, which has a default step for public download and access.

For those who don’t know what the AWS S3 is, check it out here first, then go back and complete this post.

In this article, I will explain how to upload files (in my case APKs) to Amazon S3 and retrieve the external URL of these files using Bitrise. Later, you can share these links (with public URLs) in other steps, such as posting them on a Slack channel so that teammates can access them with the click of a button.

 

💁 Where to start

Before we start, of course, we need access to Bitrise and AWS Console. After creating those accounts:

  1. Create a Bitrise project for Android if you haven’t already. By default, it creates primary and default workflows with simple Android steps.
  2. Create a S3 Bucket and get access keys to use later.

Create a S3 Bucket on your account here and leave all settings as default. After creating the bucket, the next step is to allow access to that bucket by creating an account, specifically for Bitrises. Follow the instructions on Amazon to create a new account and save the keys at the end for later use. Check the screenshots below to double-check that you have set the required permissions.

Image for post

 

Image for post

 

Image for post

 

 Creating the Bitrise step

Once the Android project is successfully created, you need to create an empty workflow that looks like the screenshot below. Find the Amazon S3 file uploader step on the marketplace. There you can search for any other Bitrise steps too.

 

Image for post

 

  1. Store the keys you saved from Amazon to the Secrets Tab as two separate variables $AWS_ACCESS_KEY_ID and $AWS_ACCESS_SECRET_KEY.
  2. A few parameters need to be specified in the Amazon S3 file upload step. You will see that some fields are marked red and should be filled in.

 

Image for post

 

  • File path — use the variable generated by the Android Build step, $BITRISE_APK_PATH
  • Amazon AWS Access Key — the access key that you saved earlier, $AWS_ACCESS_KEY_ID
  • Amazon AWS Secret Access Key — the secret access key that you saved earlier, $AWS_ACCESS_SECRET_KEY
  • Amazon S3 Bucket Name — the bucket name, in our case bitrise-s3-bucket

3. Make public access to the uploaded file.

 

Image for post

 

You can easily copy this script below as a custom step to sign an already successfully uploaded file on S3 and save the URL to a Bitrise variable. As mentioned, the link can later be used for sharing in a Slack message, for example.

 

 

envman add --key APP_S3_SIGNED_URL --value "$S3_LOCAL_VAR"

 

See that Bitrise stores this value under the $APP_S3_SIGNED_URL variable, which can be used in later steps.

 

🧐 Check if it works

You can manually run the newly created step directly from Bitrise by navigating to the Builds tab, clicking Start / Schedule a Build and typing the branch name.

 

👏 Conclusion

You have now created your own Bitrise workflow. Bitrise is a tool that already has many predefined steps created by many developers around the world. If you create your own step, for example, you can share it with all of us by following these steps.

Let me know if you find this helpful or need more information. I would be happy to give you a hand.

Cheers! đŸ»

 

The original post can be also found on https://petrovski.co/post/upload-files-to-amazon-s3-with-bitrise.

 

 

 

Tags: Android, Android App Development, AndroidDev, Amazon, Amazon S3

 

View original article at: 


 

Originally published: February 27, 2021

Android News
Practical network for Android Developers (part 3)
Practical network for Android Developers (part 3)

By Dinorah Tovar

This is the third part of this series “Practical Network for Android Developers” today we are gonna discuss Authenticators and Interceptors in OkHttp and why they are important for coding APIs.

By ProAndroidDev -
Android News
Practical network for Android Developers (part 2)
Practical network for Android Developers (part 2)

By Dinorah Tovar

This is the second part of this serial “Practical Network for Android Developers” today we are gonna discuss TSL, Certificates, and Pinning logic! Transport Layer Security (TLS) is the successor protocol to SSL. TLS is an improved version of SSL. It works in much the same way as the SSL, using encryption to protect the transfer of data and information. 

 

By ProAndroidDev -
Android News
Practical network for Android Developers (part 1)
Practical network for Android Developers (part 1)

By Dinorah Tovar

This is the first part of this serial “Practical Network for Android Developers” when we are gonna be talking about the Network data layer with a different vision that usually is addressed, cause networking on Android is difficult to work it, with multiples carriers, different and rich contents, streaming and all of this should arrive at our users without missing a single detail

By ProAndroidDev -
Android News
Animating the Compose Galaxy
Animating the Compose Galaxy

By Suleyman Fatih Giris

Since Jetpack Compose has joined our lives, it has been changing the way of our thinking and coding day by day. But more importantly, creating UI’s is becoming much easier compared to the old Android view system. This empowers developers to learn and adapt to the Compose environment in a much faster way (especially for animations 🥳).

By ProAndroidDev -
droidcon News

Tech Showcases,

Developer Resources &

Partners

/portal/rest/jcr/repository/collaboration/Groups/spaces/droidcon_hq/Documents/public/home-details/EmployerBrandingHeader
EmployerBrandingHeader
https://jobs.droidcon.com/
/portal/rest/jcr/repository/collaboration/Groups/spaces/droidcon_hq/Documents/public/employerbranding/jobs-droidcon/jobs.droidcon.com
jobs.droidcon.com

Latest Android Jobs

http://www.kotlinweekly.net/
/portal/rest/jcr/repository/collaboration/Groups/spaces/droidcon_hq/Documents/public/employerbranding/kotlin-weekly/Kotlin Weekly
Kotlin Weekly

Your weekly dose of Kotlin

https://proandroiddev.com/
/portal/rest/jcr/repository/collaboration/Groups/spaces/droidcon_hq/Documents/public/employerbranding/pad/ProAndroidDev
ProAndroidDev

Android Tech Blogs, Case Studies and Step-by-Step Coding

/detail?content-id=/repository/collaboration/Groups/spaces/droidcon_hq/Documents/public/employerbranding/Zalando/Zalando
/portal/rest/jcr/repository/collaboration/Groups/spaces/droidcon_hq/Documents/public/employerbranding/Zalando/Zalando
Zalando

Meet one of Berlin's top employers

/detail?content-id=/repository/collaboration/Groups/spaces/droidcon_hq/Documents/public/employerbranding/Academy for App Success/Academy for App Success
/portal/rest/jcr/repository/collaboration/Groups/spaces/droidcon_hq/Documents/public/employerbranding/Academy for App Success/Academy for App Success
Academy for App Success

Google Play resources tailored for the global droidcon community

Follow us

Team droidcon

Get in touch with us

Write us an Email

 

 

Quicklinks

> Code of Conduct

> Terms and Conditions

> How to hold a conference

> FAQs

> Imprint

Droidcon is a registered trademark of Mobile Seasons GmbH Copyright © 2020. All rights reserved.

powered by Breakpoint One