Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

how to enable pipeline for branches in upgraded version

Abhishek Pandey
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 29, 2024

I have created a repo and brnahces and added yml file over there but pipeline is not running .

1 answer

1 vote
Gajesh Bhat
Contributor
July 29, 2024

To enable pipelines for branches in Bitbucket Pipelines, you need to ensure that the YAML configuration file (bitbucket-pipelines.yml) is correctly set up and that the branches you want to build are included in the configuration. Here's the step by step configuration.

1. Create a bitbucket-pipelines.yml File:
Ensure that your repository contains a file named bitbucket-pipelines.yml in the root directory. This file defines the build configuration for your pipelines.

2. Check Pipeline Configuration:
The bitbucket-pipelines.yml file should define the steps and conditions under which the pipeline should run. Here’s a basic example configuration:

pipelines:
  default:
    - step:
        name: Build and Test
        script:
          - echo "Building and testing..."
  branches:
    feature/*:
      - step:
          name: Build for Feature Branch
          script:
            - echo "Building for feature branch"

In this example:
- The default pipeline runs for all branches unless overridden.
- The branches section specifies pipelines for branches matching a pattern, like feature/*.

To learn more about supported branch workflows in Bitbucket pipelines in the documentation : https://confluence.atlassian.com/bitbucket/branch-workflows-in-bitbucket-pipelines-856697482.html

3. Ensure Branch Names Match Configuration:
The branch names in your repository must match the patterns defined in the bitbucket-pipelines.yml file. If you want the pipeline to run for a specific branch or set of branches, ensure that these branches are included in the configuration.

4. Enable Pipelines in Repository Settings:
- Go to your Bitbucket repository.
- Navigate to Repository settings (found in the left sidebar).
- Under Pipelines, ensure that pipelines are enabled. If they are disabled, you can enable them here.

5. Check for Pipeline Triggers:
- Pipelines can be triggered by pushes to the branch, pull requests, or other events depending on the configuration.
- Ensure that the events you expect to trigger the pipeline are properly defined in your YAML configuration

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events