Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This article describes the process for configuring automated uploads of mobile app builds to Data Theorem, from a CI/CD pipeline in Screwdriver. At the high-level the process is the following:

  1. Retrieve the Data Theorem Upload API Key
  2. Save the Upload API Key as a Secret in Screwdriver
  3. Create a new Screwdriver job for uploading a build to Data Theorem
  4. Create a bash script for uploading a build to Data Theorem
  5. Enable caching of the mobile app build
  6. Deploy and test in CI

Step 1: Retrieve the Data Theorem Upload API Key

To be able to use the Upload API provided by Data Theorem, you must first retrieve the Upload API Key to authenticate against the API.

Please visit https://www.securetheorem.com/sdlc/api_access and copy the key labeled as “Upload API Key”.

Step 2: Save the Upload API Key as a Secret in Screwdriver

To be able to use it for sending mobile app builds to Data Theorem, we have to save the Upload API Key as a Secret in Screwdriver.

...

Enter DT_UPLOAD_API_KEY into the field with the value set to the Upload API Key that was retrieved in Step 1.

Image RemovedImage Added

Step 3: Create a new Screwdriver job for uploading a build to Data Theorem

Next is creating a new job specifically to upload the newly built binary to Data Theorem.

...

Info

The environment variable $SD_SOURCE_DIR is a convenient variable that is given to us by Screwdriver that points to the location of the checked-out code.

Please see the documentation for details and other environment variable


Step 4: Create a bash script for uploading a build to Data Theorem

Create and add the following contents to a file called: upload_mobile_binaries_to_datatheorem.sh

...

Please save this script where deemed appropriate, such as a directory with other scripts.

Step 5: Enable caching of the mobile app build

The final thing to complete this process is to enable caching in between jobs. This is needed to make the mobile app build available across multiple jobs, including the job that will upload it to Data Theorem.

...

Code Block
linenumberstrue
# ....
# Top level
cache:
  event: [path/to/built/binary]  # Things to be cached/shared between jobs

# ....
jobs:
  main:
    # ...  
# ....

Step 6: Deploy and test in CI

Please deploy all changes to CI to ensure the mobile app builds are automatically uploaded to Data Theorem.

...