Migration from Bitbucket Services to Webhooks
Asked by siddhesh.harmalkar:

#### Hello,
We are using Bitbucket pipelines as CI platform since a long time. We have configured a custom multistage pipelines in all the production ready repositories. We are using services feature from the Production ready infrastructure from Bitbucket for executing the test cases. We are using below services demons.
1. mongodb
2. mysql
3. rabbitmq
4. cassandra
5. docker
We have configure the pipeline structure in below manner : {#toc-hId--510223219}

image:  
name: ECR Image:latest  
aws:

access-key: $AWS_ACCESS_KEY_ID  
secret-key: $AWS_SECRET_ACCESS_KEY

clone:  
depth: full

definitions:  
# Caching SonarCloud artifacts will speed up your build  
caches:  
sonar: \~/.sonar/cache  
services:  
mongo:  
image: mongo:3.4-xenial  
docker:  
memory: 3072

steps:  
- step: \&sonarcloud  
name: Build \& Test project against sonarcloud  
caches:  
- sonar  
script:  
- npm install  
- pipe: sonarsource/sonarcloud-scan:1.2.1  
- pipe: sonarsource/sonarcloud-quality-gate:0.1.4  
variables:  
SONAR_TOKEN: ${SONAR_TOKEN}

- step: \&unit-test-cases  
name: Build and run Unit test cases  
script:  
- Execution Scripts  
- npm run test  
services:  
- mongo

- step: \&deployment-step  
name: Deployment  
image:  
name: 616035352558.dkr.ecr.ap-south-1.amazonaws.com/ecr-pipe:latest  
aws:  
access-key: $AWS_ACCESS_KEY_ID  
secret-key: $AWS_SECRET_ACCESS_KEY  
services:  
- docker  
caches:  
- docker  
script:  
- Deployment Scripts

pipelines:  
default:  
- parallel:  
- step: \*sonarcloud

- step: \*unit-test-cases

branches:  
development:  
- parallel:  
- step: \*sonarcloud

- step: \*unit-test-cases

#### - step:
\<\<: \*deployment-step
deployment: Development
Since Bitbucket is officially planning to deprecate service feature from Dec 2021. We need to migrate to another methodology the continue with the pipelines. Kindly suggest the alternative method with which we can execute CI from Bitbucket pipelines without using the Services Feature. Expecting a example which will suit our use case.
Thanks.
<br /> {#toc-hId-1977289614}


Answers:
author: Theodora Boudale
body: Hi [@siddhesh.harmalkar](/t5/user/viewprofilepage/user-id/3997634) ,

++We are not deprecating services in Bitbucket Pipelines++, so you don't need to take any action regarding Pipelines services.

The **Services** feature that we are deprecating is ++not related++ to Pipelines. It's a feature available from **Repository settings** of a repo (but only for older repos that already have services configured), which allowed users to set up e.g. email notifications, or a POST request to a service when the repo changes.

If you want to find which of your repos have such services set up, you can run the following API call:

```
https://api.bitbucket.org/2.0/repositories/{workspace}/?fields=values.services.*.*.*,values.full_name&role=admin
```

Replace **{workspace}** with the workspace-id of the workspace that owns your repos. After you get the repositories with services with this API call, you can open each repo on Bitbucket website, navigate to its **Repository settings** and you'll see an option **Services**.

++Please note that we are not requiring repository admins to disconnect or remove existing Services; we are only suggesting migrating any Service functionality you wish to keep to webhooks++:

* <https://support.atlassian.com/bitbucket-cloud/docs/manage-webhooks/>
* <https://support.atlassian.com/bitbucket-cloud/docs/create-and-trigger-a-webhook-tutorial/>

You can also read more info on the following community article we published:

* <https://community.atlassian.com/t5/Bitbucket-articles/Email-about-ending-Bitbucket-Services-feature/ba-p/1853515>

Services in Pipelines are not related to this feature, and you will still be able to use them. We apologize for the confusion caused by this.

If you have any questions, please feel free to let me know.

Kind regards,  
Theodora

comments: author: siddhesh.harmalkar
body: Hello Theodora and Bitbucket Team,  

This resolved the query. Thanks for the response.


author: Theodora Boudale
body: You are very welcome Siddhesh, I'm glad to have helped.

Please feel free to reach out if you ever need anything else.

Kind regards,  
Theodora


Tags: bitbucket-pipelines

cloud