Set up microservices discovery in your Bitbucket CI/CD pipelines.
Early Adopter Release
This feature is currently in early adopter release and may not be available to all users.
Overview
If your organization uses Bitbucket as a platform for hosting code repositories, you can establish an automated process for microservices discovery by configuring Bitbucket CI/CD pipelines. Automated discovery ensures consistent updates and accurate representation of microservices within your system.
Prerequisites
Before you start, prepare the following:
- A YAML manifest file
- A relevant Python script
To learn how to create a YAML file and a Python script, see Microservice Discovery Through a Manifest File.
Configuring Your Bitbucket Pipeline
The Bitbucket pipeline outlined in this guide is designed to automatically update your microservices on each push to the main
branch. This ensures your microservice fact sheets are consistently updated with the latest changes. The pipeline includes the following steps:
- Checking out your code
- Setting up Python
- Installing the necessary Python dependencies
- Invoking the SAP LeanIX service discovery Python helper
To set up this pipeline, create a new bitbucket-pipelines.yml
file in your repository root.
The following YAML script outlines the pipeline:
pipelines:
default:
- step:
name: Update Microservice
image: python:3.12
script:
- pip install --upgrade pip
- pip install requests pyyaml
- python leanix_service_discovery.py
By automating these steps, you not only streamline your microservice discovery process but also ensure accuracy and consistency in your microservice fact sheets.