Building a mobile application is not a task to be done in a day. It involves numerous phases of coding, testing, bug fixing, deployment, etc., which is time taking. Companies having multiple projects in hand face the problem of completing the projects on time, and hence, the requirement of automation is obvious. In such situations, CI/CD pipelining (continuous integration / continuous delivery) comes into the act.  Before moving forward, let’s know about the CI/CD pipeline.

Continuous Integration & Continuous Delivery Pipeline

The CI/CD is a standard set of activities aimed at simplifying the quality assurance process and software development by promoting automation. Once your pipeline is set then you’ll save a lot of time spent on designing, testing, and deploying. You can concentrate on improving your software and enhance the customer experience. However, to establish the pipeline you’ll need an integrated system. Let’s understand about that integrated system. 

Bitbucket Pipeline

To set up the pipeline, you will need an integrated system called bitbucket pipeline. It enables all CI/CD functions to be configured in a pipeline and allows you to set up triggers to launch your build automatically. Bitbucket is quite powerful as it helps you to set up an end-to-end automated mechanism that distributes the code updates through various environments without the need for human intervention.

What Is Fastlane?

Fastlane is an open-source tool used in Android & iOS development to automate complex activities, such as creating screenshots, handling supply profiles, and the release of applications.

Setting Up CI/CD Pipeline With Bitbucket & Deploying App Using Fastlane

How to set up Fastlane? 

Firstly, you need to install Fastlane and for that open your terminal and type the command fastlane init

When you’ll be asked for a package name, then enter a unique name of the package in your new app. For example, com.eyt.android.rwmagic8ball

After that, you’ll be asked for PATH TO JSON SECRET FILE, skip that. 

Now, try the command to run your new fastlane setup, given below

fastlane test

You have now created a Fastlane directory containing two files App file and Fast file, which will be used in the configuration. 

Fastlane Configuration 

After installing the Fastlane, it’s time to install Firebase CLI tools. Sign in to firebase to use it in continuous integration. Use command firebase login: ci which will give you a link. Click on that URL to authorize the account.  

Firebase App Distribution

Type command fastlane add_plugin firebase_app_distribution to enable plugin.

 

Test this first and then upload for beta build.

 

 

Move Fastlane, Android SDK, & Firebase Tools To Docker File

Set Bitbucket Pipeline

Configuration files are generally written in yml which is human readable. In iOS, the whole process will be the same, the only difference would be that in place of android SDK, you have to make iOS files.