DEV Community

Raghwendra Sonu
Raghwendra Sonu

Posted on

BitBucket CI/CD Pipelines

This feature in BitBucket allows build to get triggered on each code push. The build will execute on Docker engine so we need to create a build configuration yml file with name bitbucket-pipelines.yml . In the configuration file we will mention which image to use and different commands to build the repository.
Here is our BitBucker repo, you can use this for practicing this concept: https://bitbucket.org/raghwendrasonu/rest-assured_cucumber_project/

Goto pipeline section in BitBucket and select the Template you want to use to build your repository. In my case i am going to choose Java with Maven. Once you select that BitBucket will show default template.

Alt Text

Copy the contents and create a new file in your project with name bitbucket-pipelines.yml.

image: maven:3.6.1
pipelines:
default:
- step:
caches:
- maven
script:
- mvn -B clean install

Paste contents in this file and modify the script as your your need.
Alt Text

Once done, push the code, and you will see build is triggered automatically. Test will run and results will be displayed.

Alt Text

I hope this was informative.

Top comments (0)