TIL props in React.js

I have started learning React.js. I was mostly reading the articles on Medium from Kent C. Dodds and Tyler McGinnis, since they have the updated version of learning path available on the React.js in…


What is Bitrise

When it comes to automating testing and build deployment of web and mobile apps, there are several well-established services of continuous integration. However, it’s Bitrise that got a lot of publicity in 2017 and stands all the good chances to gain more traction in 2018.

Bitrise is a continuous integration platform focusing mainly on mobile development. Continuous integration (CI) being a commonly accepted practice of merging developer build copies to a shared mainline on a specific schedule. In other words, it is a workflow for version control and copies deployment without losing track of the development process.

Bitrise allows creating multiple workflows consisting of build steps. One app can have multiple workflows defined for it, as well as the webhooks to specify which workflow is selected for which trigger (webhook). The triggers mapped to workflows initiate builds with predefined workflows.

Build steps are programmed to perform a wide variety of functions implemented by command line scripts. All the virtual machine build steps are logged to keep the information of every step of the workflow.

So far, we’ve used Bitrise on two major mobile development projects, one of them being an iOS app already up and running on App Store. With new builds produced every single day, Bitrise automates the master build changes shipment to App Store testing. The workflow is also configured to only deliver a new build once there are changes implemented. The product owner thus, receives only the information on the significant builds shipped.

For one of our iOS apps, all the messages are collected from the commits on the project GitHub repository every day. By the end of the week or sprint, or whatever landmark, the product owner (client) comes up with a description of the fixes and new features added to the build. All the features and fixes are listed in the files that come with the commits. The assembly of these descriptions is automated by Bitrise.

All in all, each upload to TestFlight takes up to 1 hour. But because it is done by the Bitrise virtual machine, it costs nothing for us.

Fastlane is a continuous delivery tool for iOS and Android. Fastlane is a ruby-written tool and can be installed by means of ruby gems. Like Bitrise, Fastlane has build steps, called Actions. Each action is a task that has to be executed to reach some kind of result.

All Fastlane actions can be collected into single entities, called Lanes. Lanes are like workflows in Bitrise. When a lane is run in Fastlane, each action in the lane gets executed with the build failing if any of the actions does not execute properly. The lanes are defined in the files called Fastlife.

With all the parallels, Bitrise and Fastlane are not conflicting and repeating each other, but as we found out, Fastlane can significantly supplement the Bitrise involvement in a mobile development project.

2. Navigate to the project directory:

3. Initialize fastlane configuration for your project:

4. Enter your Apple ID and password to verify that your app with a proper app ID exists on iTunes Connect.

5. Specify your team if you are a member of several teams on developer.apple.com and iTunesConnect.

7. Navigate to ./fastlane/Fastlane and apply the following changes:

7.4 Remove all the lane blocks except for just one that we are going to need.

8. Configure your lane.

9. Specify the provision profiles in the “gym” action (see example below).

11. The example of Fastfile:

12. To upload the project to App Store, use the Deliverfile of the deliver tool of Fastlane. However, as we are only uploading it to TestFlight, this file is irrelevant.

13. Use the plugins (if any) via gem. For this, install it:

14. Create Gemfile in your project directory with the specific contents. In the example below, we are adding the “badge” plugin.

15. Install/update gems:

16. Push new files to the Git repository.

17. In your Bitrise workflow, set the following parameters:

17.1 Activate SSH key (RSA private key)- to use your credentials to access Git.

17.2 Git Clone Repository - to pull a branch.

17.3 Certificate and profile installer - a crucial step for provision profiles. See the Code Signing tab in the workflow editor on Bitrise. Upload the App Store and development provision profiles, development, and distribution certificates.

17.4 Run CocoaPods install - to install, update, and run CocoaPods (if your project uses them) and if you are not committing the pod files into your repository.

17.5 Brew install if your project swiftlint to check the formatting of the code. Specify swiftlint as "Name of the formula to install/upgrade" and select yes for "Upgrade formula if previously installed".

17.7 Xcode Project Info - to extract the version and build number from Info.plist to environment variables.

17.8Xcode Test for iOS - to ensure that unit tests are passing for a new build.

17.9 fastlane — to run the fastlane. Specify the lane that has to be running. In the example above, it’s beta. Check the Working directory parameter and make sure it is correct.

17.10 Script 'push build number changes' is a script to push a change of the build number back into Git:

19. Make sure you uploaded the proper provision profiles and certificates to the Code signing tab of the workflow editor. Before running the tool mentioned on that page, make sure you’ve uploaded a build to TestFlight manually at least once.

This integration allows our iOS app builds to assemble in 45–50 minutes with most of the time spent on processing the build on App Store and TestFlight.

One of the most convenient features we’ve utilized so far is the workflow interactions allowing integration with GitHub, Jira, or some other progress tracking tools. Implemented tasks get tested within the project branch before the merge. We filter tests and merge the master build after that, which means the task can be closed.

Another option is to pass the task to a test engineer for the build to be merged to staging. Every new merge is a new build. After all the work in staging, a manager knows which of these builds is the most appropriate, and can be selected for the release. This is not exactly automation yet, but the Bitrise Fastlane combo is a great way to ship application builds.

Add a comment

Related posts:

Discord Sued by Patent Troll

Last week brought bad news for gaming fans of the popular messaging platform, Discord. In a case filed on February 26, 2021, patent troll, Coretek Licensing, LLC. sued Discord, Inc., the company… Read more

Ansible Case Study

Ansible seamlessly unites workflow orchestration with configuration management, provisioning, and application deployment in one easy-to-use and deploy platform. Regardless of where you start with… Read more

What is blockchain technology in logistics?

Blockchain is a decentralized and distributed database. This technology is characterized by an ever-increasing amount of information grouped into blocks and stored chronologically. Although it was… Read more