DEV Community

loading...

Creating multiple steps in BitBucket Pipelines

raghwendrasonu profile image Raghwendra Sonu ・1 min read

This is the continuation of my previous article "BitBucket CI/CD Pipelines" https://dev.to/raghwendrasonu/bitbucket-ci-cd-pipelines-399e.

In BitBucket Pipelines, we can also have multiple steps.

Alt Text

Edit your bitbucket-pipelines.yml file with multiple steps as below:

image: maven:3.3.9
pipelines:
default:
- step:
name: Maven Clean Build
caches:
- maven
script:
- mvn -B clean
- step:
name: Maven Compile Build
caches:
- maven
script:
- mvn -B compile
- step:
name: Maven Package Build
caches:
- maven
script:
- mvn -B package

So, as you see i have 3 different steps now. First step is Clean then Compile and finally Package. Once done, push the code to BitBucket and enable pipeline.

Alt Text

After that, you will see repo getting automatically built and result of each step will be displayed.

Alt Text

BitBucket link for the Repo: https://bitbucket.org/raghwendrasonu/obfuscation_implementation/

Discussion (0)

pic
Editor guide