.gitlab-ci.ymlFile. If you just want to get your build up and running, follow these steps:
.gitlab-ci.ymlFile to your project root
Gemfileexample from below to your project root
developbranch should automatically trigger a build and upload the finished app to Updraft.
build_updraftin 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.
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
Gemfilefrom the example below in your project directory.
build_updraftis where the rest of the magic happens. The important part is the
scripttag 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_updraftand we are using a file named
.env.updraftwhere we set all the variables that Fastlane needs.
tagssection 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
developbranch. 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.
tagas you used in your
.gitlab-ci.ymlfile to restrict the runner to accept only iOS Builds.