Quokka Labs

Implementing CI/CD Pipeline for Flutter with Jenkins & BitBucket

Discover the power of Continuous Integration and Continuous Deployment (CI/CD) for your Flutter projects! With this write-up, we unveil the secrets of setting up an efficient CI/CD pipeline using two industry-leading tools.

author

By Vinamra Singh

09 Jun, 2023

In today's fast-paced software development landscape, ensuring the efficient and reliable delivery of applications is paramount. Implementing a CI/CD (Continuous Integration/Continuous Deployment) pipeline for Flutter projects can significantly streamline the development process, enabling faster feedback, automated testing, and smooth deployments.

By combining the power of Jenkins, an automation server, with BitBucket, a version control repository, developers can establish a robust CI/CD pipeline for their Flutter projects. But how can you set up the CI/CD pipeline for your Flutter projects using Jenkins and BitBucket? This blog will explore how to implement CI-CD using Jenkins with BitBucket repos.

This blog explores how to implement CI CD in Flutter using Jenkins and Bitbucket repositories in a more structured and scalable way.

Let's start with a brief introduction to CI/CD pipeline & Jenkins.

What is CI/CD Pipeline?

A CI/CD pipeline is a set of automated processes and tools that enable developers to integrate code changes, test them, and deploy the application consistently and efficiently. In the context of Flutter projects, a Flutter CI/CD pipeline helps streamline the development workflow, automate build and test processes, and ensure the smooth deployment of Flutter applications.

Workflow of CI/CD Workflow of CI/CD

How CI/CD Pipeline Works for Flutter Projects

In Case of Continuous Integration (CI):

CI regularly merges code changes from multiple developers into a shared repository. It involves committing code changes to a version control system like BitBucket for Flutter projects whenever a developer completes a task or adds a feature.

The CI Flutter pipeline for Flutter projects typically involves the following steps:

  • Code Integration: Hire flutter developer who push some changes to the repository, triggering a CI system like Jenkins.
  • Building: The CI system pulls the latest code, installs necessary dependencies, and builds the Flutter application.
  • Automated Testing: The CI system runs automated tests to verify the quality and functionality of the code.
  • Test Reports: The CI system generates test reports, providing developers with insights into any issues or failures.
  • Code Quality Checks: Additional checks like code formatting, linting, and static analysis may be performed to maintain code quality standards.
  • Notifications: The CI Flutter system notifies developers of the build status and test results, facilitating quick feedback and issue resolution.

In Case of Continuous Deployment (CD):

CD focuses on automating the application's deployment to production or staging environments after successful integration and testing. CD involves packaging the application for Flutter projects, generating release artifacts (e.g., APK or IPA files), and deploying them to the target platforms or servers.

The CD pipeline for Flutter projects typically includes the following steps:

  • Artifact Generation: Once the CI pipeline is complete and the build passes all tests, the application is packaged, and release artifacts are generated.
  • Distribution: The generated artifacts, such as APK files for Android or IPA files for iOS, are distributed to the appropriate distribution channels (e.g., app stores and staging servers).
  • Deployment Automation: The deployment process is automated, ensuring that the new version of the application is seamlessly deployed to the target environment.
  • Post-Deployment Tasks: Additional actions like database migrations, cache warming, or server restarts may be performed after deployment.

NOTE: Besides Jenkins, several other ways exist to achieve a CI/CD workflow. Some popular options are GitHub Action, CircleCI, GitLab CI/CD, Travis CI, AWS CodePipeline, Bamboo, etc.

Suggested Read: Flutter Mobile App Development: A Full-scale Guide

What is Jenkins?

What is Jenkins? Jenkins is an open-source automation server that facilitates continuous integration and delivery of software projects. It provides a robust platform for automating various stages of the software development lifecycle, including building, testing, and deploying applications. Jenkins is highly flexible and extensible, supporting various plugins and integrations with other tools and technologies.

For teams evaluating Jenkins Flutter workflows, Jenkins remains a strong option because it supports source-controlled pipelines, build agents, test automation, and release orchestration across Android and iOS environments.

Some key Features & Functionalities of Jenkins:

  • Continuous Integration: Jenkins is primarily known for its CI capabilities. It allows developers to regularly integrate code changes from multiple contributors into a shared repository. Jenkins can automatically trigger builds whenever changes are pushed to the repository, enabling early detection of integration issues.

  • Build Automation: Jenkins supports the automation of build processes. It can pull the latest code changes from version control, compile the code, and create build artifacts, such as executable files or deployable packages. Jenkins provides extensive support for various build tools and technologies, including support for Flutter Jenkins workflows.

  • Testing & Quality Assurance: Jenkins enables the execution of automated tests as part of the CI pipeline. It can run unit tests, integration tests, and other types of tests to ensure the quality and functionality of the code. Jenkins can generate reports and metrics based on the test results, helping developers identify and address issues quickly.

  • Plugin Ecosystem: Jenkins has many plugins that extend its functionality. These plugins cover many areas, such as version control systems, build tools, testing frameworks, deployment technologies, and notification systems. Developers can leverage these plugins to customize and enhance their Jenkins pipelines according to project requirements.

  • Scalability & Distribution: Jenkins is designed to handle large-scale projects and distribute build and test workloads across multiple machines or agents. This allows for parallel execution of tasks, reducing build times and increasing overall efficiency.

  • Extensibility: Jenkins provides a flexible architecture that allows developers to create custom plugins and integrations. This extensibility enables Jenkins to integrate with various tools, technologies, and services in the software development ecosystem, making it adaptable to diverse project environments.

  • Community & Support: Jenkins has a vibrant community of users and contributors who actively develop plugins, provide support, and share best practices. This active community ensures that Jenkins remains up to date with the latest industry trends and fosters a collaborative environment for knowledge exchange.

  • Open-Source & User friendly: Jenkins is free to use and has a large community of developers contributing to its ecosystem. It offers numerous plugins that enhance its functionality. Jenkins can be scaled to meet the needs of even the largest organizations. It has a user-friendly web interface that makes it easy to get started.

Overall, Jenkins is a powerful automation server that facilitates continuous integration and delivery. It enables developers to automate build, test, and deployment processes, resulting in faster feedback, improved software quality, and streamlined development workflows for Jenkins Flutter pipelines.

Core Architecture of a Modern Flutter CI/CD Pipeline

Before setting up the pipeline, it helps to understand how the overall system works. A modern Flutter CICD pipeline usually follows a simple flow, i.e. Bitbucket repository, webhook trigger, Jenkins pipeline, test stages, Android and iOS build stages, artefact storage, deployment, or release handoff.

This structure gives teams a clear path from code commit to release-ready build. Bitbucket acts as the source control layer, while Jenkins manages automation through the controller and assigned build agents. The pipeline then uses the Flutter SDK and required dependencies to run validation, testing, and platform-specific build processes.

A complete setup typically includes:

  • Bitbucket as source control for managing code, branches, and pull requests

  • Jenkins controller and build agents to run pipeline stages and distribute workloads

  • Flutter SDK and dependency environment for package installation, analysis, and testing

  • Android and iOS build toolchains for generating release-ready app builds

  • Secure credential storage for repository access, signing keys, and deployment secrets

  • Notification and reporting layer for build status, logs, and failure visibility

  • Optional release tools for internal distribution, store submission, or release handoff

Get Assistance Through an Expert Flutter App Development Company!

Now, let’s check out the step-by-step Implementation of CI/CD using Jenkins.

Implementing CI-CD Pipeline Using Jenkins

Step 1: Install Jenkins on your Mac or VM

  • Install the latest LTS version: brew install jenkins-lts
  • Install a specific LTS version: brew install jenkins-lts@YOUR_VERSION
  • Start the Jenkins service: brew services start jenkins-lts
  • Restart the Jenkins service: brew services restart jenkins-lts
  • Update the Jenkins version: brew upgrade jenkins-lts
  • Uninstall the Jenkins: brew uninstall jenkins-lts

Once installed, Jenkins typically runs on port 8080, so you can access the dashboard through your local host in a browser.

When Jenkins opens for the first time, it will request an administrator password. This password is usually stored in the Jenkins secrets directory. For example:

/Users/your-username/.jenkins/secrets/initialAdminPassword

Step 1.1

  • Now install the suggested plugins. You can also install the plugins manually. This process takes 30–45 mins. Step 1.2
  • Now create an Admin User & Start Jenkins. Step 1.3

Step 2: Create A New Pipeline

  • Once Jenkins is ready, create a new pipeline job for your Flutter project. Step 2.1
  • Enter the item name & select FreeStyle project. You can also go with the other Pipeline option.
  • From the Jenkins dashboard, click on New Item, enter the project name, and select Pipeline as the job type. This approach is preferred over Freestyle jobs because it allows you to manage the build process as code, which is easier to version, review, and maintain across teams.
    Step 2.2

Jenkins recommends storing pipeline logic in a Jenkinsfile inside the source repository rather than relying only on UI-based job configuration. This is especially useful for teams building a scalable Flutter Jenkins pipeline across multiple environments, branches, or release stages.

Step 3: Configure Pipeline

  • After creating the pipeline, the next step is to connect your Bitbucket repository to Jenkins and define how the pipeline should run.
  • Add a clear project description, then link your Git repository to Jenkins using the repository URL and the required credentials.

Step 3.1

  • Choose ‘Global credentials’ as the domain and select ‘Username with password’ as the credential type. For Bitbucket authentication, use a secure token such as a repository access token or API token rather than a regular account password.

Step 3.2 Note: Jenkins still supports credential types such as Global credentials and Username with password, but for modern Bitbucket Cloud workflows, it is better to use secure token-based authentication instead of regular account passwords. Legacy Bitbucket app passwords may still appear in older setups, but newer integrations should follow Bitbucket’s current token-based approach.

Read More: CI-CD using GitLab

Step 4: Write Script

After the repository connection is in place, define how Jenkins should build, test, and package the Flutter application.

Instead of relying only on UI-based build steps, it is better to define the workflow inside a Jenkinsfile stored in the Bitbucket repository. This keeps the CI CD in Flutter logic version-controlled and aligned with the project codebase. Jenkins documents Jenkinsfile-based Pipeline as the maintainable approach for modern automation. Apple’s current App Store Connect guidance still supports automated upload

Before writing the script, let's discuss some essential points related to the script.

  • Build Trigger: We can use this feature/option to manage our pipeline trigger behavior. For more context, please click on the Question icon.
    Step 4.1
  • Build Environment: Here, we set some configurations and settings that define the build process's environment. It allows you to customize and control various aspects of the build, such as setting up required tools, defining environment variables, configuring build parameters, and more. Step 4.2
  • Build Steps: These are the actual commands Jenkins will execute. For a Flutter project, this typically includes dependency installation, code analysis, automated testing, and platform-specific builds. Step 4.3
  • Post-Build Actions: These actions run after the main build process. They may include archiving artefacts, sending notifications, publishing reports, or triggering deployment steps. Step 4.4

A typical Flutter pipeline can include stages such as:

  • Source checkout from Bitbucket
  • flutter clean
  • flutter pub get
  • flutter analyse
  • Unit and widget tests
  • Integration tests where required
  • Android app bundle generation
  • iOS IPA generation
  • Artefact archiving
  • Optional deployment to internal testing or release channels

For sensitive values such as Apple credentials, signing keys, and platform secrets, use Jenkins Credentials instead of placing them directly inside scripts. Jenkins supports secure credential handling for pipeline workflows, which is the safer approach for production-grade CI/CD Flutter environments.

Note-1

For iOS builds, the pipeline may generate an IPA file and then pass it into the chosen release workflow. Apple’s current App Store Connect guidance still supports automated upload workflows, but release configuration should be aligned with your team’s signing, certificate, and distribution requirements.

If your team needs to expose a local Jenkins instance temporarily for webhook testing, tunnelling tools can help during development, but this should be treated as a short-term setup measure rather than a core production recommendation.

How to Connect Bitbucket to Jenkins Securely

Connecting Bitbucket to Jenkins is not just about making the integration work, but also about making sure the pipeline has the right level of access, triggers only when needed, and follows current authentication practices.

For Flutter CI/CD workflows, a secure setup helps reduce unnecessary builds, protects repository access, and keeps release automation easier to manage over time.

Here’s how you can connect Bitbucket to Jenkins securely:

  • Set up repository access securely: Use scoped credentials to connect Jenkins to the required Bitbucket repository. Store them in Jenkins Credentials instead of placing secrets directly in job settings or scripts.
  • Configure webhook triggers from Bitbucket: Use webhooks to trigger Jenkins builds automatically on relevant repository events such as branch pushes, pull requests, or merges. This is more efficient than relying on manual triggers or constant polling.
  • Define branch and merge event behaviour: Set different build behaviour for feature branches, pull requests, and release branches. Not every code change needs the full build and deployment workflow.
  • Restrict credentials by pipeline need: Give each pipeline only the access it needs. Validation pipelines should not use the same credentials as deployment pipelines.

Common mistake:

  • Many teams connect Bitbucket successfully but forget to define branch-specific triggers, which leads to unnecessary builds, longer queue times, and wasted CI resources.
  • This approach keeps the Bitbucket and Jenkins integration more secure, easier to control, and better aligned with modern CI/CD practices.

Various Challenges Faced by Developers While Implementing Jenkins

Implementing Jenkins can come with several challenges that developers may encounter. Here are some common difficulties faced during the implementation process:

Challenge 1: Flutter command may not be recognized. Challenge 1 Reason: The Jenkins server could not find Flutter, so ensure you have installed Flutter & required software like Android Studio & Xcode on your machine. Also, ensure you have added the Flutter SDK path to the Jenkins server.

Challenge 2: Generate signed AAB file failed Challenge 2 Reason: Don't forget to configure the release build in my app build.gradle file. So, ensure you have added it already.

Challenge 3: Generate IPA file failed.

Reason: If you didn’t configure the provisioning profile & certificate. Also, ensure all things are configured in your Xcode.

Challenge 4: AAB file upload sometimes failed.

Reason: You should have owner access to your Google Service Account. The rollout percentage should be zero when uploading a build as a draft.

That’s it!!!

By following these steps, you can establish a robust CI/CD pipeline for your Flutter projects using Jenkins & BitBucket. This pipeline will enable continuous integration, automated testing, artifact generation, and deployment automation, ensuring your Flutter applications are built, tested, and deployed efficiently.

Hence, Implementing a CI/CD pipeline enhances collaboration among developers and promotes faster, more reliable software releases, ultimately improving the success of your Flutter projects.

Read More: Implementing CI/CD Using GitHub Actions: A Quick Guide to Build a CI/CD Pipeline

Conclusion

Implementing a CI/CD pipeline for Flutter using Jenkins and Bitbucket helps teams move from manual build processes to a structured, automated release workflow. With the right pipeline architecture, developers can integrate code changes faster, run automated tests consistently, and generate reliable Android and iOS build artefacts.

Jenkins provides flexible automation through pipelines and build agents, while Bitbucket manages version control and event-based triggers for continuous integration.

When combined with secure credential management, proper branch strategies, and stable build environments, this setup enables teams to reduce release risks and improve development velocity. For organisations building scalable Flutter applications, a well-designed CI CD Flutter pipeline becomes an essential part of delivering reliable software.

Frequently Asked Questions

Q1. What is Bitbucket, and why should we use it?

Ans: Bitbucket is a web-based version control repository hosting service. It provides features like Git and Mercurial repositories, pull requests, and issue tracking. Using Bitbucket allows us to manage the Flutter project's source code and collaborate with a team.

Q2. How often should we trigger CI/CD pipeline builds?

Ans: The frequency of triggering builds depends on your development workflow and requirements. Common approaches include triggering builds on every commit, on a schedule (e.g., nightly builds), or when specific events occur (e.g., pull requests or tag creation).

Q3. Can we use Jenkins to deploy my Flutter app to app stores?

Ans: While Jenkins can build, package, and boost the speed of your Flutter app, deploying app stores requires additional steps specific to each store's guidelines and tools. Jenkins can be configured to trigger these deployment steps, but you must set up the appropriate tools and credentials for each app store.

Q4. Are there any alternatives to Jenkins for CI/CD?

Ans: Yes, there are several alternatives to Jenkins for CI/CD, such as GitLab CI/CD, CircleCI, Travis CI, and Azure DevOps.

Q5. Can we use other version control systems with Jenkins, like GitHub or GitLab?

Ans: Yes, Jenkins supports integration with various version control systems, including GitHub, GitLab, and Bitbucket.

Q6. How many Flutter app development companies are there in the US?

Determining the precise count of Flutter app development companies in US proves challenging due to the industry's expansive and ever-evolving nature. Nonetheless, the landscape hosts thousands of such companies, spanning from petite boutique establishments to expansive multinational agencies.

Tags

ContinuousDeployment

ContinuousIntegration

Automation

FlutterDevelopment

BitBucket

Jenkins

CI_CD

SoftwareDevelopment

DevOps

Similar blogs

blog

Technology

10 min

REST vs GraphQL for Mobile Apps: Performance, Caching, and Scaling Trade-offs Explained

The API model behind your mobile app affects load speed, caching behavior, and long-term scalability. This blog explains the real trade-offs in REST vs GraphQL for mobile apps, with a practical focus on GraphQL vs REST performance mobile, caching decisions, and smarter API design for mobile apps.

author
blog

Technology

10 min

How Logistics Software Improves Supply Chain Efficiency

Improve supply chain efficiency with logistics software that boosts visibility, automates workflows, reduces delays, and lowers costs. Learn how startups, SMEs, and enterprises use logistics automation software, supply chain optimization software, and digital logistics tools to improve delivery performance, inventory accuracy, and ROI.

author
blog

Technology

5 min

How to Develop a Sports Betting App: Step-by-Step Guide (Features, Compliance, & Cost)

Learn how to develop a sports betting app in 2026 with a compliance-firstand production-ready approach that matches real market expectations. This guide walks through the full FanDuel-like sportsbook build lifecycle, from defining your product scope and must-have features to real-time odds integration, wallet accuracy, settlement workflows, and risk controls that hold up under peak traffic. It also covers KYC, AML compliance, PCI compliance boundaries, and security practices needed for regulated launches.

author