DEV Community

Raghwendra Sonu
Raghwendra Sonu

Posted on

1 1

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.

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more