How to support a list of uploads as input with Absinthe GraphQL
As you might guess, in our day-to-day, we write GraphQL queries and mutations for Phoenix applications using Absinthe to be able to create, read, update and delete records.
If you ever need to publish your Android app in a simple way outside the Play Store, publishing the app .apk file to an S3 bucket could be a good solution. Then you’ll just need to share the generated link to that .apk file.
Here’s how to do it.
If you don’t have one already, refer to the AWS documentation for this step.
Again, refer to the AWS documentation to check how to do this. Just make sure that you select Programmatic access as the type of access for this user and save the Access Key and Secret Key.
You can either set up the S3 variables in the project build script or per individual module if you prefer. In this example, I will do it in the project. Just open the build.gradle
file and add the following code.
allprojects {
project.ext.AWS_S3_BUCKET = "YOUR BUCKET NAME"
project.ext.AWS_S3_KEY_ID = "YOUR BUCKED SECRET ID"
project.ext.AWS_S3_KEY_SECRET = "YOUR BUCKED SECRET KEY"
project.ext.AWS_S3_APK_TARGET_FOLDER = "YOUR S3 TARGET FOLDER"
}
For security reasons, I highly recommend that you save the Access Key and Secret Key as environment variables so they won’t end up in your code repository.
First, you need to download the code for the publish task, find it in this gist, and put it in your app folder.
Then, in the build.gradle
of each application you want to publish, add the following:
apply from: 'publishApkToS3.gradle'
Keep in mind that this task uses CURL, so make sure you have it installed in your machine.
Finally, you just need to execute the following command to publish your app to the S3 bucket.
publish{flavor-name}ToS3
If you’re planning on running this on your CI, add the following commands to your configuration file.
chmod +x ./gradlew
./gradlew publish{flavor-name}ToS3
Join our newsletter
Be part of our community and stay up to date with the latest blog posts.
SubscribeJoin our newsletter
Be part of our community and stay up to date with the latest blog posts.
SubscribeAs you might guess, in our day-to-day, we write GraphQL queries and mutations for Phoenix applications using Absinthe to be able to create, read, update and delete records.
If you are a Flutter developer you might have heard about or even tried the “new” way of navigating with Navigator 2.0, which might be one of the most controversial APIs I have seen.
A database cron job is a process for scheduling a procedure or command on your database to automate repetitive tasks. By default, cron jobs are disabled on PostgreSQL instances. Here is how you can enable them on Amazon Web Services (AWS) RDS console.