Using the Generic File Storage

Last updated at 2021-04-08

Japanese translation unavailable

This page has not been translated into Japanese yet - we apologise for the inconvenience! If you’re interested in helping us out, feel free to translate any article in the jp folder of the DevCenter repository and open a PR!

このページは日本語への翻訳がまだ完了しておりません。ご不便をおかけして申し訳ございません! もしお手伝いできる方がいらっしゃれば、ご自由にjpフォルダの記事を日本語に訳していただき、PRを開いてください

Uploading files to GENERIC FILE STORAGE on

  1. Open your app on
  2. Go to Workflow tab and open the Workflow Editor
  3. On the left side of the Workflow Editor select Code Signing
  4. Scroll down to Generic File Storage section.
  5. Enter your unique ID before dropping your file into the Upload file field.

Env Var for the download URL

Bitrise will upload your file and assign an environment variable to the file’s download url. A time limited, read only download URL will be set as the value of this Environment Variable for every build. You can use this URL to download the file during a build.

Protecting the uploaded files in GENERIC FILE STORAGE

Once you uploaded a file to GENERIC FILE STORAGE, you can set your uploaded files to Protected mode. This means that no one can download or reveal the file from your account but your builds can still use them. Once you click Make protected, Bitrise will handle the Env Var attached to your uploaded files as secret Env Var.

  1. Click the horizontal ellipsis button and select Make protected.

    Using the Generic File Storage

  2. Click Make it protected in the pop-up window.

Note that since the file is now protected, you can only overwrite it if you delete it and upload a new one again.

Using the files uploaded to GENERIC FILE STORAGE on

There are two ways to use the uploaded files.

For example, the Decrypt file Step supports using the download URL generated when uploading the file. You just need to insert the variable as the value to the Encrypted file path input.

For using the File Downloader Step or the Script Step, check out our examples:

Downloading a file using the File Downloader step

Assuming the file’s GENERIC FILE STORAGE url is assigned to BITRISEIO_MY_FILE_ID_URL, the Step would look like:

- file-downloader:
    - source: "$BITRISEIO_MY_FILE_ID_URL"
    - destination: "$BITRISE_SOURCE_DIR/path/to/store/the/file"

You can set the location as an App Env Var instead of specifying it directly for the destination input. That way you can refer the file through the environment variable in other steps, you won’t have to specify the path every time.

For example, if you specify the BITRISEIO_MY_FILE_LOCAL_PATH as an App Env Var, you can use it as the download destination:

- file-downloader:
    - source: "$BITRISEIO_MY_FILE_ID_URL"
    - destination: "$BITRISEIO_MY_FILE_LOCAL_PATH"

Then in subsequent steps, you can use the same $BITRISEIO_MY_FILE_LOCAL_PATH env var as the file path.

Downloading a file and exporting the file’s path using a Script step

Assuming the file’s GENERIC FILE STORAGE url is assigned to BITRISEIO_MY_FILE_ID_URL, the script step would look like this:

- script:
    - content: |
        set -ex

        # specify local download path

        # download the file
        wget -O "$file_local_path" "$BITRISEIO_MY_FILE_ID_URL"
        echo "file downloaded to: $file_local_path"

        # OPTIONALLY: export the file's local path, to be able to use it in subsequent steps as an input value
        envman add --key BITRISEIO_MY_FILE_LOCAL_PATH --value "$file_local_path"

In subsequent steps, you can refer to the downloaded file’s path with_ $BITRISEIO_MY_FILE_LOCAL_PATH.

Alternatively, for example, you can set the location as an App Env Var and simply download it to that path instead of defining the path inside the Script.