As an indie developer, anything that saves you time or automates work is valuable. As shown in the previous blog post, Bitrise very quickly and easily sets up a cloud-based continuous integration (CI) system for your app that will run every time you push an update to your repository.
Automatic continuous integration
Automatic continuous integration is a great thing to have that can run your automated tests in the cloud and help you keep the quality of your app high. Whether integrating and testing the code from multiple developers, or running more comprehensive tests in the cloud, this adds value and saves you a lot of time.
Continuous integration tests will pick up bugs and it is also a great way to find regression issues — things that used to work and have stopped due to the accidental impact of other changes you have made. By building a suite of tests that repeatedly run automatically in the cloud, with good code coverage, you are keeping your app robust.
Moving on: the CD part
Testing your app often involves other people. The more people spend time testing your app, the more chances they have to find different bugs. And you may want to deploy it to testers early and often.
Bitrise provides an infrastructure to automatically deliver new versions of your app to your testers. Bitrise also makes it easy to set this up and automate it! 👀
Automated continuous delivery to testers
Continuous delivery — and deployment to test devices — is the CD part of the Bitrise CI/CD system.
You can trigger Bitrise to run a deployment build using the trigger of your choice. Bitrise will run a Workflow that will build and deploy your app to a public Bitrise website. It can even email your testers directly when a new version is available with a web link provided to download the APK to their Android device, or to download an .ipa file for iOS.
One important thing to note: you must provide the signing capabilities to allow Bitrise to sign your app. We'll help you go through this together in subsequent articles.
With the deployment Workflow fully set up, you have added a deployment Workflow to your primary default Workflow. These two Workflows will have triggers that kick them off. The primary Workflow we previously covered will run every time you push an update of code to your repository. (This is the default trigger setting).
Triggering your deployment Workflow
The new deployment Workflow will be triggered by the option you choose. Typically a push to the repository is not the best reason to kick off the deployment Workflow. The deployment Workflow will make the app available to testers, and you will normally only want to do this when your app is in a state that you consider ready for deployment to testers.
This, of course, is dependent on your processes, but a common approach is to version the app when it is ready to be deployed to testers. This is done by tagging the app in the repository where the app is hosted.
Let’s say for example v0.5.6+12 = version 0.5.6 build 12. If you tag your app with a consistent format, you can use it to trigger your deployment build on Bitrise. You do this by selecting the tag trigger:
And, in this example supplying a tag wild card of v*.*.* to trigger the deploy Workflow.
Deployment runs automatically using your version tag
With this setup, every time you tag a commit of your code with the v*.*.* format, for example v0.5.6+12 as in the example above, and push that tag to your repository, the deployment build will start running because the tag matches your wildcard definition.
So now you can start the deployment Workflow by pushing a tagged version in your repository. With this addition, you have regular iterations of builds on Bitrise that provide you with a continuous integration and deployment processes that run in the cloud. All you have to do to operate it is push updates to your code and push version tags: Bitrise does all of the rest for you automatically.
By setting up the triggers this way, with a push to the repository triggering your CI build, and tagging a version to run the CD build, you have created a cloud based system that supports all of your development and testing process.
Let’s look at how Bitrise automates this and makes it easy for you!
- When you add your repository to your Bitrise account, Bitrise looks into your repository code and identifies the type of build needed. After that, it automatically sets up a build and test Workflow and a separate, build test and deploy Workflow.
- Bitrise will run the build and test Workflow every time you push an update to your repository.
- By adding a simple trigger using a tag, plus adding signing to your app in Bitrise, you will have a build, test and deploy Workflow running, every time you version your app.
- Bitrise offers the additional benefit of keeping the build system up to date with the latest releases of development tools from Apple, and Google. This is all taken care of for you.
Maintaining your other and older apps
Once you have automated your development with Bitrise, your other or older apps become easier to maintain. Making minor changes to update an app you haven’t looked at for a while is OK, but you are more likely to accidentally trigger a regression bug. Knowing you will have a comprehensive set of tests that automatically run in the cloud and report back to you gives you confidence that you will avoid making a breaking change.
Not having to remember the steps you made to deploy the app, because they are still stored in your Bitrise system is also a time saver.
You may be focused on just one app now, but all of your apps benefit from using Bitrise.
App/Play Store deployment next!
Once this is running for you, you will want to move on to automating deployment to the App Store or Play Store. This will be covered in the next article in this series.
It takes a few minutes to set up Bitrise to run your first build and test run in the cloud.
With just a little more effort, you will have added automated deployment to allow testers to download and run the latest versions of your app. You are then able to focus your time on building a great app.
More time to relax and enjoy the sun or your personal life. Just code, we will handle the rest!