This guide explains how to set up and run each script in the repository. Each section includes the required blueprints, environment variables, and instructions for running the script.
- Install the Port Azure DevOps integration
- Retrieve your Port credentials
- Create a Personal Access token in Azure DevOps
- Retrieve your organization url in Azure DevOps
- Ingests monorepos from Azure DevOps and maps them to the Service blueprint in Port.
- Ingests Azure DevOps pipeline runs and maps them to the
azure_devops_pipeline_run
blueprint.
- Ingests API specs from repository files and maps them to the
api_spec
blueprint.
- Identifier:
monorepo
- Schema:
{ "identifier": "monorepo", "title": "Monorepo", "schema": { "properties": { "name": { "type": "string", "title": "Name" }, "description": { "type": "string", "title": "Description" }, "url": { "type": "string", "title": "Repository URL", "format": "url" } } } }
Run the following commands:
export PORT_CLIENT_ID="your-port-client-id"
export PORT_CLIENT_SECRET="your-port-client-secret"
export AZURE_DEVOPS_ORG_URL="https://dev.azure.com/your-org"
export AZURE_DEVOPS_PAT="your-azure-devops-pat"
export PORT_API_URL="https://api.getport.io/v1"
export REPOS='[{"project_name": "Your Project", "repo_name": "Your Repo"}]'
export TARGET_PATH="/services"
Run the script using:
python ingesting-monorepos/ado-monorepos.py
- Identifier:
azure_devops_pipeline_run
- Schema:
{ "identifier": "azure_devops_pipeline_run", "title": "Azure DevOps Pipeline Run", "schema": { "properties": { "pipeline_name": { "type": "string", "title": "Pipeline Name" }, "status": { "type": "string", "title": "Status" }, "result": { "type": "string", "title": "Result" }, "url": { "type": "string", "title": "URL", "format": "url" }, "created_at": { "type": "string", "title": "Created At", "format": "date-time" }, "finished": { "type": "string", "title": "Finished", "format": "date-time" } } } }
Run the following commands:
export PORT_CLIENT_ID="your-port-client-id"
export PORT_CLIENT_SECRET="your-port-client-secret"
export AZURE_DEVOPS_ORG_URL="https://dev.azure.com/your-org"
export AZURE_DEVOPS_PAT="your-azure-devops-pat"
export PORT_API_URL="https://api.getport.io/v1"
export PIPELINE_BLUEPRINT_ID="azure_devops_pipeline_run"
Run the script using:
python ingesting-pipeline-runs/azure_pipeline_runs.py
- Identifier:
api_spec
- Schema:
{ "identifier": "api_spec", "title": "API Spec", "schema": { "properties": { "swagger_ui": { "type": "string", "title": "Swagger UI", "format": "yaml", "spec": "open-api" } }, "relations": { "service": { "target": "service", "title": "Service", "required": false, "many": false } } } }
Run the following commands:
export PORT_CLIENT_ID="your-port-client-id"
export PORT_CLIENT_SECRET="your-port-client-secret"
export AZURE_DEVOPS_ORG_URL="https://dev.azure.com/your-org"
export AZURE_DEVOPS_PAT="your-azure-devops-pat"
export PORT_API_URL="https://api.getport.io/v1"
export API_SPEC_BLUEPRINT_ID="api_spec"
export SWAGGER_PATH_PATTERN="**/swagger*.yaml"
Run the script using:
python ingesting-repo-files/api-specs/api-specs.py