Skip to content

Commit 24ec9c0

Browse files
authored
Merge pull request #2502 from port-labs/digcs-43
Update Humanitec integration docs to contain newly supported resources
2 parents 2dabdd2 + 0601b2b commit 24ec9c0

18 files changed

+1262
-220
lines changed

docs/guides/all/humanitec-integration.md

Lines changed: 103 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -15,98 +15,152 @@ import HumanitecExporterMainScript from "/docs/guides/templates/humanitec/_human
1515
import HumanitecExporterRequirements from "/docs/guides/templates/humanitec/_humanitec_exporter_requirements.mdx";
1616
import HumanitecExporterPortClient from "/docs/guides/templates/humanitec/_humanitec_exporter_port_client.mdx";
1717
import HumanitecExporterHumanitecClient from "/docs/guides/templates/humanitec/_humanitec_exporter_humanitec_client.mdx";
18+
import HumanitecGroups from "/docs/guides/templates/humanitec/_humanitec_groups.mdx";
19+
import HumanitecUsers from "/docs/guides/templates/humanitec/_humanitec_users.mdx";
20+
import HumanitecPipelines from "/docs/guides/templates/humanitec/_humanitec_pipelines.mdx";
21+
import HumanitecDeploymentDeltas from "/docs/guides/templates/humanitec/_humanitec_deployment_deltas.mdx";
22+
import HumanitecDeploymentSets from "/docs/guides/templates/humanitec/_humanitec_deployment_sets.mdx";
23+
import HumanitecSecretStores from "/docs/guides/templates/humanitec/_humanitec_secret_stores.mdx";
24+
import HumanitecValueSetVersions from "/docs/guides/templates/humanitec/_humanitec_value_set_versions.mdx";
25+
import HumanitecSharedValues from "/docs/guides/templates/humanitec/_humanitec_shared_values.mdx";
26+
1827

1928
# Humanitec Integration
2029

21-
## Overview
30+
This guide demonstrates how to create a GitHub worklow integration to facilitate the ingestion of Humanitec applications, environments, workloads, resources, resource graphs, pipelines, deployment deltas, deployment sets, secret stores, shared values, value set versions, users, groups into your Port catalog on schedule.
2231

23-
In this example, you are going to create a github worklow integration to facilitate the ingestion of Humanitec applications, environments, workloads, resources and resource graphs into your port catalog on schedule
32+
<img src="/img/guides/humanitecEnvironments.png" alt="Humanitec Integration" width="75%" border="1px" />
2433

25-
:::info Prerequisites
34+
## Common use cases
2635

27-
1. In your GitHub repository, [go to **Settings > Secrets**](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository) and add the following secrets:
28-
- `HUMANITEC_API_KEY` - [Humanitec API Key](https://developer.humanitec.com/platform-orchestrator/reference/api-references/#authentication)
29-
- `HUMANITEC_ORG_ID` - [Humanitec Organization ID](https://developer.humanitec.com/concepts/organizations/)
30-
- `PORT_CLIENT_ID` - Your port `client id` [How to get the credentials](https://docs.port.io/build-your-software-catalog/sync-data-to-catalog/api/#find-your-port-credentials).
31-
- `PORT_CLIENT_SECRET` - Your port `client secret` [How to get the credentials](https://docs.port.io/build-your-software-catalog/sync-data-to-catalog/api/#find-your-port-credentials).
32-
:::
36+
- Empower platform teams to gain visibility and advanced insights into your Humanitec entities including application, environments, users, and groups from Port among other entities.
37+
- Track the status of changes to your Humanitec entities from Port.
38+
- Prepare your Port environment to build useful experiences for Platform Engineering teams with Self Service Actions.
39+
40+
## Prerequisites
41+
42+
This guide assumes the following:
43+
- You have a Port account and have completed the [onboarding process](https://docs.port.io/getting-started/overview).
44+
- You have a Humanitec account and a [Service User created](https://developer.humanitec.com/platform-orchestrator/docs/platform-orchestrator/security/service-users/) (You need an Administrator or Manager privilege to create a Service User).
45+
- You have a GitHub account and a repository.
46+
47+
48+
## Set up data model
49+
50+
As a first step, you need to create blueprint definitions in Port for the Humanitec entities you want to ingest. To do this follow the steps below:
51+
52+
1. Go to the [Builder](https://app.getport.io/settings/data-model/data-model) page in your Port organization.
53+
2. Click on the **+ Blueprint** button at the top of the page.
54+
3. Click on `{...} Edit JSON` button at the top right corner.
55+
4. Copy and paste the following blueprint JSON into the editor, repeating the process for each blueprint:
56+
57+
<HumanitecApplicationBlueprint/>
58+
59+
<HumanitecEnvironmentBlueprint/>
3360

34-
## Port blueprints
61+
<HumanitecWorkloadBlueprint/>
3562

36-
Create the following blueprint definitions in port:
63+
<HumanitecResourceGraphBlueprint/>
3764

38-
<HumanitecApplicationBlueprint/>
65+
<HumanitecResourceBlueprint/>
3966

40-
<HumanitecEnvironmentBlueprint/>
67+
<HumanitecSecretStores/>
4168

42-
<HumanitecWorkloadBlueprint/>
69+
<HumanitecSharedValues/>
4370

44-
<HumanitecResourceGraphBlueprint/>
71+
<HumanitecValueSetVersions/>
72+
73+
<HumanitecDeploymentSets/>
74+
75+
<HumanitecPipelines/>
76+
77+
<HumanitecDeploymentDeltas/>
78+
79+
<HumanitecUsers/>
80+
81+
<HumanitecGroups/>
4582

46-
<HumanitecResourceBlueprint/>
4783

4884
:::tip Blueprint Properties
4985
You may select the blueprints depending on what you want to track in your Humanitec account.
5086
:::
5187

52-
## GitHub Workflow
88+
## Set up the integration
5389

54-
:::tip
5590
Fork our [humanitec integration repository](https://github.com/port-labs/humanitec-integration-script.git) to get started.
56-
:::
57-
1. Create the following Python files in a folder name `integration` folder at the root of your GitHub repository:
58-
1. `main.py` - Orchestrates the synchronization of data from Humanitec to Port, ensuring that resource entities are accurately mirrored and updated on your port catalog.
59-
2. `requirements.txt` - This file contains the dependencies or necessary external packages need to run the integration
60-
61-
<details>
62-
<summary>Main Executable Script</summary>
6391

64-
<HumanitecExporterMainScript/>
6592

66-
</details>
93+
### Add secrets to your GitHub repository
6794

68-
<details>
69-
<summary>Requirements</summary>
95+
In your GitHub repository, [go to **Settings > Secrets**](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository) and add the following secrets:
96+
- `HUMANITEC_API_KEY` - [Humanitec API Key](https://developer.humanitec.com/platform-orchestrator/docs/platform-orchestrator/security/service-users/#generate-an-api-token-from-a-service-user)
97+
- `HUMANITEC_ORG_ID` - [Humanitec Organization ID](https://developer.humanitec.com/concepts/organizations/)
98+
- `PORT_CLIENT_ID` - Your Port `client id` [How to get the credentials](https://docs.port.io/build-your-software-catalog/sync-data-to-catalog/api/#find-your-port-credentials).
99+
- `PORT_CLIENT_SECRET` - Your Port `client secret` [How to get the credentials](https://docs.port.io/build-your-software-catalog/sync-data-to-catalog/api/#find-your-port-credentials).
70100

71-
<HumanitecExporterRequirements/>
72101

73-
</details>
102+
### Create the Python files
103+
104+
1. Create the following Python files in a folder named `integration` at the base directory of your GitHub repository:
105+
- `main.py` - Orchestrates the synchronization of data from Humanitec to Port, ensuring that resource entities are accurately mirrored and updated on your Port catalog.
106+
- `requirements.txt` - This file contains the dependencies or necessary external packages need to run the integration
107+
108+
109+
110+
<details>
111+
<summary><b>Main Executable Script (Click to expand)</b></summary>
112+
113+
<HumanitecExporterMainScript/>
114+
115+
</details>
116+
117+
118+
<details>
119+
<summary><b>Requirements (Click to expand)</b></summary>
120+
121+
<HumanitecExporterRequirements/>
122+
123+
</details>
124+
74125

75126
2. Create the following Python files in a folder named `clients` at the base directory of the `integration` folder:
76-
1. `port_client.py` – Manages authentication and API requests to Port, facilitating the creation and updating of entities within Port's system.
77-
2. `humanitec_client.py` – Handles API interactions with Humanitec, including retrieving data with caching mechanisms to optimize performance.
78-
3. `cache.py` - Provides an in-memory caching mechanism with thread-safe operations for setting, retrieving, and deleting cache entries asynchronously.
127+
- `port_client.py` – Manages authentication and API requests to Port, facilitating the creation and updating of entities within Port's system.
128+
- `humanitec_client.py` – Handles API interactions with Humanitec, including retrieving data with caching mechanisms to optimize performance.
129+
- `cache.py` - Provides an in-memory caching mechanism with thread-safe operations for setting, retrieving, and deleting cache entries asynchronously.
79130

80-
<details>
81-
<summary>Port Client</summary>
131+
<details>
132+
<summary><b>Port Client (Click to expand)</b></summary>
82133

83-
<HumanitecExporterPortClient/>
134+
<HumanitecExporterPortClient/>
84135

85-
</details>
136+
</details>
86137

87-
<details>
88-
<summary>Humanitec Client</summary>
138+
<details>
139+
<summary><b>Humanitec Client (Click to expand)</b></summary>
89140

90-
<HumanitecExporterHumanitecClient/>
141+
<HumanitecExporterHumanitecClient/>
91142

92-
</details>
143+
</details>
93144

94145

95-
<details>
96-
<summary>Cache</summary>
146+
<details>
147+
<summary><b>Cache (Click to expand)</b></summary>
97148

98-
<HumanitecExporterCacheScript/>
149+
<HumanitecExporterCacheScript/>
99150

100-
</details>
151+
</details>
101152

102-
3. Create the file `.github/workflows/humanitec-exporter.yaml` in the `.github/workflows` folder of your repository.
153+
### Create the GitHub workflow
154+
155+
Create the file `.github/workflows/humanitec-exporter.yaml` in the `.github/workflows` folder of your repository.
103156

104157
:::tip Cron
105158
Adjust the cron expression to fit your schedule. By default, the workflow is set to run at 2:00 AM every Monday ('0 2 * * 1').
106159
:::
107160

161+
108162
<details>
109-
<summary>GitHub Workflow</summary>
163+
<summary><b>GitHub Workflow (Click to expand)</b></summary>
110164

111165
```yaml showLineNumbers title="humanitec-exporter.yaml"
112166
name: Ingest Humanitec Integration Resources
@@ -146,5 +200,5 @@ jobs:
146200
</details>
147201
148202
149-
Done! Any change that happens to your application, environment, workloads or resources in Humanitec will be synced to Port on the schedule interval defined in the GitHub workflow.
203+
Done! Any change that happens to your application, environment, workloads, resources, resource graphs, pipelines, deployment deltas, deployment sets, secret stores, shared values, value set versions, users, groups in Humanitec will be synced to Port on the schedule interval defined in the GitHub workflow.
150204

docs/guides/templates/humanitec/_humanitec_application_blueprint.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<details>
2-
<summary>Humanitec Application Blueprint</summary>
2+
<summary><b>Humanitec Application Blueprint (Click to expand)</b></summary>
33

44
```json showLineNumbers
55
{
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<details>
2+
<summary><b>Humanitec Deployment Deltas (Click to expand)</b></summary>
3+
4+
```json showLineNumbers
5+
{
6+
"identifier": "humanitecDeploymentDelta",
7+
"title": "Humanitec Deployment Delta",
8+
"icon": "Deployment",
9+
"schema": {
10+
"properties": {
11+
"status": {
12+
"title": "Status",
13+
"description": "The status of the deployment delta",
14+
"type": "string",
15+
"icon": "DefaultProperty"
16+
},
17+
"createdAt": {
18+
"title": "Created At",
19+
"description": "The date and time when the deployment delta was created",
20+
"type": "string",
21+
"format": "date-time",
22+
"icon": "DefaultProperty"
23+
},
24+
"createdBy": {
25+
"title": "Created By",
26+
"description": "The user who created the deployment delta",
27+
"type": "string",
28+
"icon": "DefaultProperty"
29+
},
30+
"comment": {
31+
"title": "Comment",
32+
"description": "Comment for the deployment delta",
33+
"type": "string",
34+
"icon": "DefaultProperty"
35+
},
36+
"environment": {
37+
"title": "Environment",
38+
"description": "The environment for the deployment delta",
39+
"type": "string",
40+
"icon": "DefaultProperty"
41+
}
42+
},
43+
"required": []
44+
},
45+
"mirrorProperties": {},
46+
"calculationProperties": {},
47+
"aggregationProperties": {},
48+
"relations": {
49+
"humanitecApplication": {
50+
"title": "Application",
51+
"target": "humanitecApplication",
52+
"required": false,
53+
"many": false
54+
}
55+
}
56+
}
57+
```
58+
59+
</details>
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<details>
2+
<summary><b>Humanitec Deployment Sets (Click to expand)</b></summary>
3+
4+
```json showLineNumbers
5+
{
6+
"identifier": "humanitecDeploymentSet",
7+
"title": "Humanitec Deployment Set",
8+
"icon": "Deployment",
9+
"schema": {
10+
"properties": {
11+
"version": {
12+
"title": "Version",
13+
"description": "The version of the deployment set",
14+
"type": "string",
15+
"icon": "DefaultProperty"
16+
},
17+
"createdAt": {
18+
"title": "Created At",
19+
"description": "The date and time when the deployment set was created",
20+
"type": "string",
21+
"format": "date-time",
22+
"icon": "DefaultProperty"
23+
},
24+
"createdBy": {
25+
"title": "Created By",
26+
"description": "The user who created the deployment set",
27+
"type": "string",
28+
"icon": "DefaultProperty"
29+
},
30+
"comment": {
31+
"title": "Comment",
32+
"description": "Comment for the deployment set",
33+
"type": "string",
34+
"icon": "DefaultProperty"
35+
}
36+
},
37+
"required": []
38+
},
39+
"mirrorProperties": {},
40+
"calculationProperties": {},
41+
"aggregationProperties": {},
42+
"relations": {
43+
"humanitecApplication": {
44+
"title": "Application",
45+
"target": "humanitecApplication",
46+
"required": false,
47+
"many": false
48+
}
49+
}
50+
}
51+
```
52+
53+
</details>

docs/guides/templates/humanitec/_humanitec_environment_blueprint.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<details>
2-
<summary> Humanitec Environment Blueprint</summary>
2+
<summary><b>Humanitec Environment Blueprint (Click to expand)</b></summary>
33

44
```json showLineNumbers
55

0 commit comments

Comments
 (0)