GitOps
Port's Bitbucket integration makes it possible to manage Port entities with a GitOps approach, making your code repositories into the source of truth for the various infrastructure assets you want to manage.
๐ก Bitbucket GitOps common use casesโ
- Use Bitbucket as the source-of-truth for your microservices, packages, libraries and other software catalog assets;
- Allow developers to keep the catalog up-to-date, by making updates to files in their Git repositories;
- Create a standardized way to document software catalog assets in your organization;
- etc.
Managing entities using GitOpsโ
To manage entities using GitOps, you will need to add a port.yml
file to the default branch (usually main
) of your repository.
The port.yml
file can specify one or more Port entities that will be ingested to Port, and any change made to the port.yml
file will also be reflected inside Port.
This configuration turns your Bitbucket repositories to the source-of-truth for the software catalog.
GitOps port.yml
fileโ
The port.yml
file is how you specify your Port entities that are managed using GitOps and whose data is ingested from your Git repositories.
Here are examples for valid port.yml
files:
- Single entity
- Multiple entities
identifier: myEntity
title: My Entity
blueprint: myBlueprint
properties:
myStringProp: myValue
myNumberProp: 5
myUrlProp: https://example.com
relations:
mySingleRelation: myTargetEntity
myManyRelation:
- myTargetEntity1
- myTargetEntity2
- identifier: myEntity1
title: My Entity1
blueprint: myFirstBlueprint
properties:
myStringProp: myValue
myNumberProp: 5
myUrlProp: https://example.com
relations:
mySingleRelation: myTargetEntity
myManyRelation:
- myTargetEntity1
- myTargetEntity2
- identifier: myEntity
title: My Entity2
blueprint: mySecondBlueprint
properties:
myStringProp: myValue
myNumberProp: 5
myUrlProp: https://example.com
Since both of the valid port.yml
formats follow the same structure, the following section will explain the format based on the single entity example.
port.yml
structureโ
Here is an example port.yml
file:
identifier: myEntity
title: My Entity
blueprint: myBlueprint
properties:
myStringProp: myValue
myNumberProp: 5
myUrlProp: https://example.com
relations:
mySingleRelation: myTargetEntity
myManyRelation:
- myTargetEntity1
- myTargetEntity2
- The
identifier
key is used to specify the identifier of the entity that the app will create and keep up-to-date when changes occur:
identifier: myEntity
title: My Entity
...
- The
title
key is used to specify the title of the entity:
identifier: myEntity
title: My Entity
...
- The
blueprint
key is used to specify the identifier of the blueprint to create this entity from:
...
title: My Entity
blueprint: myBlueprint
...
- The
properties
key is used to map the values to the different properties of the entity:
...
title: My Entity
blueprint: myBlueprint
properties:
myStringProp: myValue
myNumberProp: 5
myUrlProp: https://example.com
...
- The
relations
key is used to map target entities to the different relations of the entity:
- Single relation
- Many relation
...
properties:
myStringProp: myValue
myNumberProp: 5
myUrlProp: https://example.com
relations:
mySingleRelation: myTargetEntity
...
properties:
myStringProp: myValue
myNumberProp: 5
myUrlProp: https://example.com
relations:
myManyRelation:
- myTargetEntity1
- myTargetEntity2
Examplesโ
Check out the example repository for a microservice blueprint and a matching port.yml
file which specifies a microservice entity.
Advancedโ
Refer to the advanced page for advanced use cases and configurations.