> For the complete documentation index, see llms.txt.
Skip to main content

Check out Port for yourself ➜ 

Integrate assets using GitOps

Port allows you to use Gitops to manage Port entities, making your code repositories the source of truth for the various infrastructure assets you want to manage.

You can use this approach to ingest microservices, projects, packages, libraries, and other assets into Port, and keep them up-to-date with your infrastructure.

To use Gitops with Port, head over to your desired Git provider:

Build a custom GitOps integration

If none of the providers above fit your use-case, you can build a custom GitOps integration using Port's API.

Check existing integrations first

Before writing custom logic to integrate Port into your GitOps process, check our existing CI/CD integrations.

Common use cases

  • Use your Git provider 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.

Managing entities using custom GitOps

To manage entities using GitOps, add a json file to microservice repository containing the entity JSON.

Then, whenever your CI/CD process runs, an automated check will review whether the contents of the file changed, and will send the new file contents to Port's API using a simple API call, thus always keeping your microservice entity up to date.

Example

Create a local JSON file, named entity.json, with the following content:

{
"identifier": "notification-microservice",
"title": "Notification Service",
"properties": {
"url": "https://www.github.com/user/notification"
}
}

Save this file to your version control repository. Then as part of your CI/CD, use create entities route, to add your new Microservice:

blueprint_id='microservice'

curl --location --request POST "https://api.port.io/v1/blueprints/${blueprint_id}/entities" \
--header "Authorization: Bearer $access_token" \
--header "Content-Type: application/json" \
--data @entity.json

# The output of the command contains the content of the resulting entity

Now, whenever your CI/CD runs, it will report the latest definition of the entity to Port, giving you the latest information directly in Port.

API token required

Remember that an access token is needed to make API requests, refer back to Getting an API token if you need to generate a new one.