Create A CI/CD pipeline With Fabric&Bitbucket For Android Application
We’ll learn in this tutorial how we can use Bitbucket’s pipeline feature for Android CI/CD.
Why we need CI/CD when developing an application?
When you develop an application sometimes your colleagues want holder last feature a demo. And you have to build an apk distribute to your colleagues or you have to upload fabric beta. This is a terrible method.
For this scenario, we have a solution. This solution’s name is CI/CD. But what is CI/CD? You can find detail information at the bottom link.
We’ll use this platforms:
- Fabric.io
- Bitbucket
First, we need a Git repository for build last apk’s code. We’ll use Bitbucket. Create a repo at Bitbucket and push your last commit. After pushing your last commit you can open project’s Bitbucket repo. (Don’t forget before pushing your last commit you have to initialize Fabric https://fabric.io/kits/android/crashlytics/install)
You can see “Deployments” at the left menu please click to that area. And past at the bottom Yaml file.
chmod a+x ./gradlew: That is mean give permission to “./gradlew” don’t format add to yaml file.
pull-requests: feature/* : If you use Git Flow when developing the project if you create a pull request to development branch from a feature branch it’ll distribute apk after merged. You do not have to use that code.
./gradlew assembleDebug crashlyticsUploadDistributionDebug : Build apk and distribute to Fabric Beta
You can save and push new comment to Bitbucket. You can see the last status of building your apk at “Pipelines” area.
Now if you want to build an apk and distribute to Fabric Beta you can only push comment to Bitbucket it’ll distribute instead you.