Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions docs/app-distribution/ci-tools/bitbucket.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
id: bitbucket
title: Bitbucket Pipelines
sidebar_label: Bitbucket Pipelines
description: Upload iOS and Android builds to Mobile App Distribution automatically from your Bitbucket Pipelines.
---

import useBaseUrl from '@docusaurus/useBaseUrl';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

Set up Bitbucket Pipelines to upload your build artifacts (IPA or APK) directly to Sauce Labs Mobile App Distribution for distribution.

## Setting Up

1. Open your Bitbucket repository, and select **Settings** > **Pipelines** > **Environment Variables**

<img src={useBaseUrl('/img/testfairy/ci-tools/bitbucket-pipelines-0.png')} alt="screenshot of Bitbucket pipelines"/>

2. Fill in **variable** and **value**:

- **Variable**: TESTFAIRY_API_KEY
- **Value**: _Your API key. Find it under **API Credentials** in the top navigation bar, or in the **API Key** section of **My Profile**. See [API Keys](/app-distribution/security/api-keys) for details._
- **Secured**: Y

3. Click **Add**.

<img src={useBaseUrl('/img/testfairy/ci-tools/bitbucket-pipelines-1.png')} alt="screenshot of Bitbucket pipelines"/>

4. Edit your `bitbucket-pipelines.yml` and add this command to your `script` section:

```bash
curl https://app.testfairy.com/api/upload -F api_key=${TESTFAIRY_API_KEY} -F file=@MyApplicationFile.apk -F format=readable
```

:::caution
Do not forget to replace `MyApplicationFile.apk` with the path to your APK or IPA files.
:::

Additional optional parameters such as `testers-groups`, `notify`, and `comment` can be added to this line. Refer to the [Upload API reference guide](/app-distribution/developer/legacy-api-v1#upload) for more information and examples.

Here is a screenshot of a sample `bitbucket-pipelines.yml` file:

Check warning on line 42 in docs/app-distribution/ci-tools/bitbucket.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/app-distribution/ci-tools/bitbucket.md#L42 <sauce.MeaningfulLinkWords>

Improve SEO and accessibility by rewriting 'Here' in the link text.
Raw output
{"message":"Improve SEO and accessibility by rewriting 'Here' in the link text.","location":{"path":"docs/app-distribution/ci-tools/bitbucket.md","range":{"start":{"line":42,"column":1},"end":{"line":42,"column":5}}},"severity":"WARNING","code":{"value":"sauce.MeaningfulLinkWords"}}

<img src={useBaseUrl('/img/testfairy/ci-tools/bitbucket-pipelines-2.png')} alt="screenshot of Bitbucket pipelines"/>
38 changes: 38 additions & 0 deletions docs/app-distribution/ci-tools/circle-ci.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
id: circle-ci
title: Circle CI
sidebar_label: Circle CI
description: Upload iOS and Android builds to Mobile App Distribution from CircleCI using the Mobile App Distribution orb.
---

import useBaseUrl from '@docusaurus/useBaseUrl';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

[CircleCI](https://circleci.com) is a cloud-based CI/CD service that helps developers automate their development process with CI hosted in the cloud or on a private server.

Sauce Labs Mobile App Distribution has a CircleCI "ORB", allowing you to upload builds to Sauce Labs Mobile App Distribution smoothly.

To use the ORB, add the following line to the `orbs` section of your `.circleci/config.yml`:

```yml
orbs:
testfairy: testfairy/uploader@2.0.1
```

Then, upload your .IPA or .APK, you'll have to call `testfairy/uploader`, providing the path to the file and your API key. As an example of creating, add the following command:

```yml
jobs:
build:
# ...
steps:
# ... steps to build IPA or APK
- testfairy/uploader:
api-key: TESTFAIRY_API_KEY
file: app.apk
```

`TESTFAIRY_API_KEY` is the environment variable name containing your API key. Environment variables are the best practice, so you don't commit secret values into your code repository.

You can see the complete list of supported commands by visiting the [CircleCI Sauce Labs Mobile App Distribution ORB Repository](https://circleci.com/orbs/registry/orb/testfairy/uploader).
154 changes: 154 additions & 0 deletions docs/app-distribution/ci-tools/fastlane.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
---
id: fastlane
title: Fastlane
sidebar_label: Fastlane
description: Install and use the saucelabs_appdist Fastlane plugin to upload builds to Mobile App Distribution.
---

import useBaseUrl from '@docusaurus/useBaseUrl';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

Upload a new build to Sauce Labs Mobile App Distribution using Fastlane and the `fastlane-plugin-saucelabs_appdist` plugin. You can find your API key under **API Credentials** in the top navigation bar, or in the **API Key** section of **My Profile**. See [API Keys](/app-distribution/security/api-keys).

## Installation

```bash
fastlane add_plugin saucelabs_appdist
```

Or add the plugin manually to your project's `fastlane/Pluginfile`:

```ruby
gem 'fastlane-plugin-saucelabs_appdist'
```

Then run `bundle install` to fetch it.

## Usage

<Tabs>
<TabItem value="ios" label="iOS" default>

```ruby
saucelabs_appdist(
api_key: "your_api_key",
ipa: "./path/to/app.ipa",
comment: "Build #{lane_context[SharedValues::BUILD_NUMBER]}",
)
```

</TabItem>
<TabItem value="android" label="Android">

```ruby
saucelabs_appdist(
api_key: "your_api_key",
apk: "../build/app/outputs/apk/qa/release/app-qa-release.apk",
comment: "Build #{lane_context[SharedValues::BUILD_NUMBER]}",
)
```

</TabItem>
</Tabs>

### Parameters

| Key | Description | Default |
|-----------------------|----------------------------------------------------------------|---------------------------|
| `api_key` | API Key for Sauce Labs Mobile App Distribution | |
| `ipa` | Path to your IPA file (iOS) | |
| `apk` | Path to your APK file (Android) | |
| `symbols_file` | Symbols mapping file | |
| `upload_url` | Upload API URL for Sauce Labs Mobile App Distribution | `https://app.testfairy.com` |
| `testers_groups` | Array of tester groups to be notified | `[]` |
| `comment` | Additional release notes for this upload | `No comment provided` |
| `auto_update` | Auto-upgrade users (`on`/`off`) | `off` |
| `notify` | Send email to testers (`on`/`off`) | `off` |
| `options` | Array of options | `[]` |
| `custom` | Custom options string | `""` |
| `timeout` | Request timeout in seconds | |
| `tags` | Custom tags for builds | `[]` |
| `metrics` | Array of metrics to record | `[]` |
| `folder_name` | Dashboard folder name | `""` |
| `landing_page_mode` | Landing page visibility (`open`/`closed`) | `open` |
| `upload_to_saucelabs` | Upload to Sauce Labs (`on`/`off`) | `off` |
| `platform` | Platform override | `""` |
| `community_token` | Custom URL token for the landing page | `""` |
| `app_description` | Description text to display on the landing page | `""` |

:::note
If your server's security settings require users to login before downloading, you must set `landing_page_mode: "closed"`. Otherwise the upload will fail with error code 156.
:::

### Lane Variables

The `saucelabs_appdist` action stores the full API response in `lane_context`, which can be accessed in subsequent actions or lanes:

```ruby
lane_context[SharedValues::SAUCELABS_APPDIST_UPLOAD_RESPONSE]
```

The response is a hash containing all fields from the upload API, including:

| Key | Description |
|------------------------------------|---------------------------------------------------|
| `status` | Upload status (`ok` on success) |
| `build_id` | ID of the uploaded build |
| `project_id` | ID of the project |
| `app_name` | Name of the uploaded app |
| `app_version` | Version of the uploaded app |
| `file_size` | Size of the uploaded file in bytes |
| `build_url` | URL for the sessions of the newly uploaded build |
| `download_page_url` | URL of the download page |
| `app_url` | Direct download URL for the build |
| `invite_testers_url` | URL to invite testers to this build |
| `icon_url` | URL of the app icon |
| `options` | Configured options for this build |
| `platform` | Platform (iOS/Android) |
| `tags` | Tags associated with the build |
| `metadata` | Metadata associated with the build |
| `has_testfairy_sdk` | Whether the app includes the TestFairy SDK |
| `symbols_download_url` | URL to download symbols file (if uploaded) |
| `landing_page_url` | URL of the build's landing page |
| `build_specific_landing_page_url` | Landing page URL specific to this build |
| `attachments` | Attachments associated with the build |
| `landing_page_mode` | Landing page visibility (`open` or `closed`) |
| `app_description` | Description text displayed on the landing page |

Example:

```ruby
response = lane_context[SharedValues::SAUCELABS_APPDIST_UPLOAD_RESPONSE]
puts response['build_url']
puts response['app_url']
puts response['landing_page_url']
```

### Documentation

To show the documentation in your terminal, run

```bash
fastlane action saucelabs_appdist
```

### CLI

It is recommended to add the above action into your Fastfile, however sometimes you might want to run one-offs. To do so, you can run the following command from your terminal

```bash
fastlane run saucelabs_appdist
```

To pass parameters, make use of the `:` symbol, for example

```bash
fastlane run saucelabs_appdist api_key:"your_key" ipa:"./app.ipa"
```

It's important to note that the CLI supports primitive types like integers, floats, booleans, and strings. Arrays can be passed as a comma delimited string (e.g. `param:"1,2,3"`). Hashes are not currently supported.

Check notice on line 150 in docs/app-distribution/ci-tools/fastlane.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/app-distribution/ci-tools/fastlane.md#L150 <sauce.WordsToAvoid>

Avoid usage of 'note that'.
Raw output
{"message":"Avoid usage of 'note that'.","location":{"path":"docs/app-distribution/ci-tools/fastlane.md","range":{"start":{"line":150,"column":19},"end":{"line":150,"column":28}}},"severity":"INFO","code":{"value":"sauce.WordsToAvoid"}}

Check notice on line 150 in docs/app-distribution/ci-tools/fastlane.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/app-distribution/ci-tools/fastlane.md#L150 <sauce.LatinTerms>

Use 'for example' instead of 'e.g.', but consider rewriting the sentence.
Raw output
{"message":"Use 'for example' instead of 'e.g.', but consider rewriting the sentence.","location":{"path":"docs/app-distribution/ci-tools/fastlane.md","range":{"start":{"line":150,"column":158},"end":{"line":150,"column":162}}},"severity":"INFO","code":{"value":"sauce.LatinTerms"}}

Check warning on line 150 in docs/app-distribution/ci-tools/fastlane.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/app-distribution/ci-tools/fastlane.md#L150 <sauce.CurrentStatus>

Remove 'currently'. The documentation reflects the current state of the product.
Raw output
{"message":"Remove 'currently'. The documentation reflects the current state of the product.","location":{"path":"docs/app-distribution/ci-tools/fastlane.md","range":{"start":{"line":150,"column":196},"end":{"line":150,"column":205}}},"severity":"WARNING","code":{"value":"sauce.CurrentStatus"}}

It is recommended to add all fastlane actions you use to your Fastfile.

You can find the plugin on [RubyGems](https://rubygems.org/gems/fastlane-plugin-saucelabs_appdist) and [GitHub](https://github.com/saucelabs/fastlane-plugin-saucelabs_appdist).
47 changes: 47 additions & 0 deletions docs/app-distribution/ci-tools/gitlab.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
id: gitlab
title: Gitlab
sidebar_label: Gitlab
description: Deploy iOS and Android builds to Mobile App Distribution automatically from a GitLab CI/CD pipeline.
---

import useBaseUrl from '@docusaurus/useBaseUrl';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

To automatically deply your Android or iOS Apps to [Sauce Labs Mobile App Distribution](https://app.testfairy.com/) by using GitLab, follow the steps below:

1. In Sauce Labs Mobile App Distribution, click **API Credentials** in the top navigation bar, or click the **Profile** icon in the top-right corner and select **My Profile**. Your key is in the **API Key** section.

<img src={useBaseUrl('/img/app-distribution/ci-tools/ci-tools-2.png')} alt="API Key section on the My Profile page" width="100%"/>

2. Copy your API key and go to your application's project **Settings** > **CI/CD** > **Variables** in GitLab.
3. Add a variable called `TESTFAIRY_API_KEY` to the list with the value of your API key.

<img src={useBaseUrl('/img/testfairy/ci-tools/gitlab_secret_keys.png')} alt="gitlab secret keys"/>

- To deploy, add a job to your `.gitlab-ci.yml` configuration using [fastlane](https://docs.fastlane.tools/getting-started/ios/beta-deployment/) or `curl` (example below).

```yaml
stages:
- deploy

deploy:
stage: deploy
only:
- master
script:
- |
curl \
-A "GitLab CI" \
-F api_key="${TESTFAIRY_API_KEY}" \
-F comment="GitLab Pipeline build ${CI_COMMIT_SHA}" \
-F file=@android.apk \
https://app.testfairy.com/api/upload/
```

:::note
Replace the `-F file=@android.apk` argument with a path to your APK or IPA.
:::

For a complete list of available options, visit the [Upload API reference guide](/app-distribution/developer/legacy-api-v1#upload).
48 changes: 48 additions & 0 deletions docs/app-distribution/ci-tools/team-city.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
id: team-city
title: TeamCity
sidebar_label: TeamCity
description: Deploy iOS and Android builds to Mobile App Distribution automatically from a TeamCity build configuration.
---

import useBaseUrl from '@docusaurus/useBaseUrl';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

To automatically deply your Android or iOS Apps to [Sauce Labs Mobile App Distribution](https://www.testfairy.com/) by using TeamCity, follow the steps below:

1. In Sauce Labs Mobile App Distribution, click the **Profile** icon in the top-right corner and select **My Profile**.

<img src={useBaseUrl('/img/app-distribution/ci-tools/ci-tools-1.png')} alt="User menu with My Profile highlighted" width="100%"/>

2. On the **My Profile** page, go to the **API Key** section and click the **copy icon** to copy the API key. You can also copy it from **API Credentials** in the top navigation bar.

<img src={useBaseUrl('/img/app-distribution/ci-tools/ci-tools-2.png')} alt="API Key section on the My Profile page" width="100%"/>

3. In TeamCity, add an environment variable as a **New Parameter** into the **Build Configuration**.

<img src={useBaseUrl('/img/testfairy/ci-tools/teamcity-configuration-4.png')} alt="build configuration"/>

4. Name the parameter `env.TESTFAIRY_API_KEY` and give it the value you copied from the Sauce Labs Mobile App Distribution **My Profile** page, and Save.

<img src={useBaseUrl('/img/testfairy/ci-tools/teamcity-configuration-5.png')} alt=" add environment variable"/>

5. Add a **Build Step** to the **Build Configuration** you wish to deploy from.

<img src={useBaseUrl('/img/testfairy/ci-tools/teamcity-configuration-1.png')} alt="add build step"/>

6. Make sure to select a **Command Line** build step.

<img src={useBaseUrl('/img/testfairy/ci-tools/teamcity-configuration-2.png')} alt="command line build step"/>

Copy the following command into the **Custom script** text field:

```bash
curl https://app.testfairy.com/api/upload -F api_key=${env.TESTFAIRY_API_KEY} -F comment="TeamCity build" -F file=@android.apk
```

:::note
Replace the `-F file=@android.apk` argument with a path to your own APK or IPA.
:::

For a complete list of available options, visit the [Sauce Labs Mobile App Distribution Upload API documentation](/app-distribution/developer/legacy-api-v1#upload).
Loading
Loading