Public install page URLs for multiple apps

Hi @clee46,

Thanks for asking this here! :wink:

So, based on what you wrote, you most likely have one Deploy to Bitrise.io step in your workflow, and two different steps which create the apps (Xcode Archive for iOS and Gradle Runner (?) for Android).

To have separate URLs for both, the trick is that you can add more than one Deploy to Bitrise.io steps, and change the Deploy directory or file path (deploy_path) input of the steps from the default $BITRISE_DEPLOY_DIR, one to the path of the APK and one to the path of the IPA. In the Workflow Editor you can click into this input and then click on the “Insert Variable” button which appears, that’ll give you a full list of available env vars you can use (e.g. Xcode Archive exports the IPA path as BITRISE_IPA_PATH).

There’s one more step, as even if you have two, separate Deploy to Bitrise.io steps, both will write its output into the same env var (BITRISE_PUBLIC_INSTALL_PAGE_URL), the second overwriting the vaule of the first one.

It’s on our roadmap to provide a built in solution for this problem, so that you can change the env var’s name where the step stores its output - EDIT this is now supported, since Bitrise CLI 1.6.0; example:

    steps:
    - deploy-to-bitrise-io:
        inputs:
        - deploy_path: file/path/one
        outputs:
        - BITRISE_PUBLIC_INSTALL_PAGE_URL: FIRST_INSTALL_PAGE
    - deploy-to-bitrise-io:
        inputs:
        - deploy_path: file/path/two
        outputs:
        - BITRISE_PUBLIC_INSTALL_PAGE_URL: SECOND_INSTALL_PAGE

Previous solution, before the built in output alias support:

It’s on our roadmap to provide a built in solution for this problem, so that you can change the env var’s name where the step stores its output, right now you’ll have to use a Script step after the first Deploy to Bitrise.io step to copy the value of BITRISE_PUBLIC_INSTALL_PAGE_URL into another env var. You can find more info about our proposal here: Output from multiple instances of the same step (“How to reference outputs of separate steps which expose outputs with the same environment variable key”), and a solution which you can do right now (using a Script step) here: How to override environment variables through the Build Trigger API

TL;DR; add a Script step right after the output is generated (in this case after the first Deploy to Bitrise.io step) and “copy” the value of that output into another env var using envman. E.g.:

#!/bin/bash
set -ex
envman add --key MY_APK_INSTALL_PAGE_URL --value "$BITRISE_PUBLIC_INSTALL_PAGE_URL"

After this in subsequent steps you can access $MY_APK_INSTALL_PAGE_URL and get the value of the first Deploy to Bitrise.io step. You can repeat this for the second deploy step too if you want to have a more descriptive env var for your Slack message (e.g. MY_APK_INSTALL_PAGE_URL & MY_IPA_INSTALL_PAGE_URL), or simply reference the second/last deploy step’s output with the default $BITRISE_PUBLIC_INSTALL_PAGE_URL env var.

I hope this helps, and hopefully we can release the built in solution in the near future, until that if you have any questions just let us know! :wink:

2 Likes