Skip to content

Latest commit

 

History

History
74 lines (47 loc) · 2.07 KB

secure_files.adoc

File metadata and controls

74 lines (47 loc) · 2.07 KB

Secure Files

You might have API keys and other secrets that your app needs to consume — either at run time or during a build. However, you might not want to check these secrets into your source code to make them available to your app.

In order to securely propagate your credentials to your build and app, buddybuild provides three sets of variables that you can define:

  1. Environment Variables (made available to your build time scripts)

  2. Device Variables (available your App at run time via the buddybuild SDK)

  3. Secure Files (files made available to your build time scripts)

Let’s get started with Secure Files!

Step 1: Upload a Secure File to buddybuild

Launch the buddybuild dashboard and select App Settings.

The buddybuild dashboard

In the left navigation, select Build settings, then Secure files.

The Secure files button

Select the file you would like to upload and select Upload file

The Secure files screen

Your file is now ready to be consumed by your app.

Step 2: Consume the secure file in your build

Your secure files are automatically consumed by tools that are expecting them.

2a. Consume in your custom build scripts.

If you would like to access them in your custom build scripts, use the bash variable expansion syntax.

./Example.framework/run ${BUDDYBUILD_SECURE_FILES}/file.txt

2b. Consume in Android build.gradle file.

If you are building an Android app with Gradle (Android Studio), you can also access them 2 ways inside your build.gradle file.

You can access them via System.getenv(), like this:

signing.keyId=1234567
signing.password=secret
signing.secretKeyRingFile= new File(System.getenv("BUDDYBUILD_SECURE_FILES") + "/secring.gpg")

That’s it! For more details, refer to our SDK API guide.