App Distribution for iOS, Android and Windows
DashboardStart for free
  • Updraft App Distribution Documentation
  • Microsoft App Center Alternative
    • Windows App Distribution
    • App Center Migration Tool
  • Welcome to Updraft!
    • What is Updraft?
  • Quickstart
    • Register your Organization
    • Your first app project
      • Upload your first app versions (builds)
      • Install your app
  • Dashboard
    • Create Projects
    • Latest received Feedbacks
    • Documentation
    • Usermanagement
      • Permission Groups
      • Tester Dashboard
    • Profile & User Account
      • Profile Preferences
        • Two-factor authentication
      • Personal token
      • Notifications
      • Organizations
      • Account Settings
      • Plan & Billing
        • Free Plan
        • Paid Plan (Pay-As-You-Go)
      • Security (Single Sign-On)
        • Single Sign-On with Okta
        • Single Sign-On with Google Worspace
        • Single Sign-On with Microsoft Entra
        • Single Sign-On with JumpCloud
        • Single Sign-On with Ping Identity
        • Custom SSO (SAML)
      • Developer Accounts
        • App Store Connect API
        • Google Play Connect API
  • Your Projects
    • Project Settings
      • Overview
      • Automatically clean up build binaries
      • Notification Integrations
        • Slack integration
        • Webhook integration
        • Microsoft Teams integration
        • Discord integration
        • WebEx integration
      • User & Permissions
    • App Overview & App Settings
      • Notifications
      • Security
      • Last uploaded build
      • Add another app to your project
      • Android App Bundle (AAB)
    • Builds and App versions
      • Build history / app version history
        • iOS Resigning
        • Android Resigning
      • Release Notes
      • Exchange already uploaded app version
      • Distribute and install a pre-release version of your app
        • App download page
    • Feedback
    • App Distribution
      • Testers & Distribution Groups
      • Distribute your app
        • Single Release
        • Beta Release (one link two apps)
        • Store
          • App Store Distribution
          • Play Store Distribution
      • Release History
      • Install an app distributed from Updraft
  • Integrations
    • Jenkins Plugin Updraft
    • Fastlane
    • Gradle
    • Teamcity with Gradle (Android)
    • Teamcity
    • GitLab CI/CD
      • GitLab iOS with Fastlane
      • GitLab app distribution for iOS builds
      • GitLab app distribution for Android builds
    • Bitrise
  • API
    • Upload API
    • Upload Apps with CURL
    • Rest API
      • Distribution group and Permission group API
  • Updraft SDK
    • Autoupdate
    • Integrating Updraft Android SDK
    • Integrating Updraft iOS SDK
    • Integrating Updraft Flutter SDK
  • Android
    • Unknown sources in Android
    • .apk installation on Samsung Browser
    • Android FAQ
    • 🪅Android Icon Troubleshooting
    • Google Play Store upload issues
  • iOS
    • Untrusted Enterprise Developer
    • Code Signing Explained (Certificates, Identifiers, Profiles – what?)
    • Registering a UDID for Ad Hoc Distribution
    • What does "App could not be installed at this time" mean?
    • iPadOS on Safari
    • iOS FAQ
  • Data Security
    • Data hosting in Switzerland
      • Swiss data privacy law
    • End to end data encryption
    • General Data Protection Regulation (GDPR)
    • Single Sign On (SSO)
    • Custom Storage
      • Google Cloud Storage
      • Custom S3 bucket
    • ISO 27001
  • What's New/ Changelog
  • Roadmap
  • FAQ
  • Contact us
Powered by GitBook
On this page
  • Uploading a build to Updraft with Gitlab
  • Quick Start
  • EXAMPLE .GITLAB-CI.YML
  • Detailed Discussion
  • EXAMPLE GEMFILE
  • Setting up a Build Runner
  1. Integrations
  2. GitLab CI/CD

GitLab iOS with Fastlane

Gitlab CI/CD can be used to deploy iOS apps with Fastlane to Updraft.

PreviousGitLab CI/CDNextGitLab app distribution for iOS builds

Last updated 5 years ago

Uploading a build to with Gitlab

In order to build and upload your iOS apps with GitLab CI, you need to set up first. Once you are able to build and upload your app locally using Fastlane, setting up GitLab CI is just a matter of running Fastlane from your .gitlab-ci.yml script.

Quick Start

Below you can see an example .gitlab-ci.yml File. If you just want to get your build up and running, follow these steps:

  • Copy the .gitlab-ci.yml File to your project root

  • Copy the Gemfile example from below to your project root

  • Make sure you have set up Fastlane with a lane called build_updraft

  • Ensure that for Fastlane you use an environment file called .env.updraft

  • Set up a GitLab CI build agent that can handle iOS builds (more on this below)

Once you fulfill these requirements, pushing to the develop branch should automatically trigger a build and upload the finished app to Updraft.

If you want to take a deep dive and customize your build, here's an overview over the different components of the .gitlab-ci.yml setup.

EXAMPLE .GITLAB-CI.YML

stages:
  - build_updraft

variables:
  LC_ALL: "en_US.UTF-8"
  LANG: "en_US.UTF-8"

before_script:
  - gem install bundler
  - bundle install

build_updraft:
  dependencies: []
  stage: updraft_staging
  script:
    - fastlane deploy_updraft --env updraft
  tags:
    - ios-dev
  only:
     - develop

Detailed Discussion

First you declare your build stages (just build_updraft in this case). Think of these like different Lanes in Fastlane. You could set up different build stages for different branches, or run multiple build stages in succession. We recommend starting with just one stage, you can always set up more builds later, for example if you want to build your app for both a staging and production CMS at the same time.

The next interesting part is before_script. Here you can set some shell commands to be run before any of the build stages. In this case, we want to make sure that the build runner ("agent") where the actual build will happen has the necessary dependencies, most likely Fastlane and Cocoapods. These commands simply tell the machine to install any Gems specified in the Gemfile. You can just place the Gemfile from the example below in your project directory.

EXAMPLE GEMFILE

source "https://rubygems.org"

gem "fastlane"
gem "cocoapods"

build_updraft is where the rest of the magic happens. The important part is the script tag where all we do is call Fastlane, which will handle the rest of the build and upload process. Notice we have a lane in our Fastfile called deploy_updraft and we are using a file named .env.updraft where we set all the variables that Fastlane needs.

Setting up a Build Runner

A build runner is a physical or virtual machine that has the necessary tools to run your builds. As an iOS Dev, you probably know you need a macOS Machine with Xcode Tools to build your iOS apps. In our Office, we use Mac Minis for this.

If you've read until here, you have earned our respect! We hope our guide has been helpful to you. If you have any questions, feel free to contact our support.

Again, if you are unsure on how to do this, check out the setup guide. The tags section is used to select the correct build agent. Since you only want build runners that can handle iOS (i.e. macOS machines with Xcode installed) to run your build, you need to set this tag on both your build stage and during the setup of your build runner. The last section, only, makes sure that the branch is run only when pushing to the develop branch. You can adapt this to your branching setup or remove it entirely if you want to build from all branches. You can even use a Regex Syntax, for example /^release\/.*$/ to build from any release branch.

Once you have a machine that can handle iOS Builds, you can follow the steps in the to set up your own runner. Make sure to specify the same tag as you used in your .gitlab-ci.yml file to restrict the runner to accept only iOS Builds.

Updraft
Fastlane
Fastlane
GitLab Documentation