Skip to content

Port 14552 deployment environment tags releases #2557

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: PORT-14552-document-github-ocean
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
- [`repository`](https://docs.github.com/en/rest/repos/repos#get-a-repository)
- [`pull-request`](https://docs.github.com/en/rest/pulls/pulls#get-a-pull-request)
- [`file`](/build-your-software-catalog/sync-data-to-catalog/git/github/#ingest-files-from-your-repositories)

- [`environment`](https://docs.github.com/en/rest/deployments/environments#get-an-environment)
- [`deployment`](https://docs.github.com/en/rest/deployments/deployments#get-a-deployment)
- [`releases`](https://docs.github.com/en/rest/releases/releases#list-releases)
- [`tags`](https://docs.github.com/en/rest/repos/repos#list-repository-tags)
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<details>
<summary>Deployment blueprint</summary>

```json showLineNumbers
{
"identifier": "githubDeployment",
"title": "Deployment",
"icon": "Deployment",
"schema": {
"properties": {
"description": {
"title": "Description",
"type": "string"
},
"ref": {
"title": "Ref",
"type": "string"
},
"sha": {
"title": "Sha",
"type": "string"
},
"transientEnvironment": {
"title": "Transient Running Service",
"type": "boolean"
},
"productionEnvironment": {
"title": "Production Running Service",
"type": "boolean"
},
"createdAt": {
"title": "Created At",
"type": "string",
"format": "date-time"
},
"url": {
"title": "URL",
"type": "string",
"icon": "Link",
"format": "url"
}
},
"required": []
},
"mirrorProperties": {},
"calculationProperties": {},
"relations": {
"runningService": {
"title": "Running Service",
"target": "githubRepoEnvironment",
"required": false,
"many": false
}
}
}
```

</details>
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<details>

<summary> Port port-app-config.yml </summary>

```yaml
createMissingRelatedEntities: true
repositoryType: 'all'
resources:
- kind: repository
selector:
query: "true" # JQ boolean query. If evaluated to false - skip syncing the object.
port:
entity:
mappings:
identifier: ".name" # The Entity identifier will be the repository name.
title: ".name"
blueprint: '"githubRepository"'
properties:
readme: file://README.md
url: .html_url
defaultBranch: .default_branch
- kind: environment
selector:
query: "true"
port:
entity:
mappings:
identifier: .__repository + '-' + .name
title: .name
blueprint: '"githubRepoEnvironment"'
properties:
url: .html_url
customBranchesPolicies: .custom_branches_policies
protectedBranches: .protected_branches
createdAt: .created_at
updatedAt: .updated_at
relations:
repository: .__repository
- kind: deployment
selector:
query: "true"
port:
entity:
mappings:
identifier: .__repository + '-' + (.id|tostring)
title: .task + '-' + .environment
blueprint: '"githubDeployment"'
properties:
description: .description
ref: .ref
sha: .sha
productionEnvironment: .production_environment
transientEnvironment: .transient_environment
createdAt: .created_at
url: .url
relations:
environment: .__repository + '-' + .environment
```

</details>
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<details>
<summary>Running Service blueprint</summary>

```json showLineNumbers
{
"identifier": "githubRepoEnvironment",
"title": "Running Service",
"icon": "Environment",
"schema": {
"properties": {
"url": {
"icon": "DefaultProperty",
"title": "URL",
"type": "string",
"format": "url"
},
"createdAt": {
"title": "Created At",
"type": "string",
"format": "date-time",
"icon": "DefaultProperty"
},
"updatedAt": {
"title": "Updated At",
"type": "string",
"format": "date-time"
},
"protectedBranches": {
"title": "Protected Branches",
"type": "boolean"
},
"customBranchPolicies": {
"title": "Custom Branch Policies",
"type": "boolean"
}
},
"required": []
},
"mirrorProperties": {},
"calculationProperties": {},
"relations": {
"repository": {
"target": "githubRepository",
"required": true,
"many": false
}
}
}
```

</details>
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<details>
<summary>Release blueprint</summary>

```json showLineNumbers
{
"identifier": "githubRelease",
"title": "Release",
"icon": "Github",
"schema": {
"properties": {
"release_creation_time": {
"icon": "DefaultProperty",
"type": "string",
"title": "Release creation time",
"format": "date-time"
},
"author": {
"type": "string",
"title": "Author"
},
"description": {
"type": "string",
"title": "Description"
}
},
"required": []
},
"mirrorProperties": {},
"calculationProperties": {},
"aggregationProperties": {},
"relations": {
"repository": {
"title": "Repository",
"target": "githubRepository",
"required": false,
"many": false
},
"tag": {
"title": "Tag",
"target": "githubTag",
"required": false,
"many": false
}
}
}
```

</details>
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<details>

<summary> Port port-app-config.yml </summary>

```yaml showLineNumbers
repositoryType: 'all'
resources:
- kind: repository
selector:
query: "true" # JQ boolean query. If evaluated to false - skip syncing the object.
port:
entity:
mappings:
identifier: ".name" # The Entity identifier will be the repository name.
title: ".name"
blueprint: '"githubRepository"'
properties:
readme: file://README.md
url: .html_url
defaultBranch: .default_branch
- kind: tag
selector:
query: 'true'
port:
entity:
mappings:
identifier: .name
title: .name
blueprint: '"githubTag"'
properties:
commit_sha: .commit.sha
relations:
repository: .__repository
- kind: release
selector:
query: 'true'
port:
entity:
mappings:
identifier: .name
title: .name
blueprint: '"githubRelease"'
properties:
author: .author.login
description: .body
release_creation_time: .created_at
relations:
tag: .tag_name
repository: .__repository
```

</details>
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<details>
<summary>Tag blueprint</summary>

```json showLineNumbers

{
"identifier": "githubTag",
"title": "Tag",
"icon": "Github",
"schema": {
"properties": {
"commit_sha": {
"icon": "DefaultProperty",
"type": "string",
"title": "Commit sha"
}
},
"required": []
},
"mirrorProperties": {},
"calculationProperties": {},
"aggregationProperties": {},
"relations": {
"repository": {
"title": "Repository",
"target": "githubRepository",
"required": false,
"many": false
}
}
}
```

</details>
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ import PRBlueprint from './\_github_exporter_example_pull_request_blueprint.mdx'
import PortAppConfig from './\_github_exporter_example_port_app_config.mdx'
import GitHubResources from '../\_github_exporter_supported_resources.mdx'

import RepoEnvironmentBlueprint from './example-deployments-environments/\_github_exporter_example_environment_blueprint.mdx'
import DeploymentBlueprint from './example-deployments-environments/\_github_exporter_example_deployment_blueprint.mdx'
import PortRepoDeploymentAndEnvironmentAppConfig from './example-deployments-environments/\_github_exporter_example_deployments_and_environments_port_app_config.mdx'

import TagBlueprint from './example-repository-release-tag/\_github_exporter_example_tag_blueprint.mdx'
import ReleaseBlueprint from './example-repository-release-tag/\_github_exporter_example_release_blueprint.mdx'
import RepositoryTagReleaseAppConfig from './example-repository-release-tag/\_github_exporter_example_release_tag_port_app_config.mdx'

import PackageBlueprint from './example-file-kind/\_example_package_blueprint.mdx'
import PackageAppConfig from './example-file-kind/\_package_json_app_config.mdx'

Expand Down Expand Up @@ -60,7 +68,29 @@ The following example demonstrates ingestion of dependencies from a `package.jso
The example will parse the `package.json` file in your repository and extract the dependencies into Port entities.
For more information about ingesting files and file contents, click [here](/build-your-software-catalog/sync-data-to-catalog/git/github-ocean/#ingest-files-from-your-repositories).

## Map repositories, deployments and environments

In the following example you will ingest your GitHub repositories, their deployments and environments to Port, you may use the following Port blueprint definitions and `port-app-config.yml`:

<RepositoryBlueprint/>

<RepoEnvironmentBlueprint/>

<DeploymentBlueprint/>

<PortRepoDeploymentAndEnvironmentAppConfig/>

## Map repositories, repository releases and tags

In the following example you will ingest your GitHub repositories, their releases and tags to Port, you may use the following Port blueprint definitions and `port-app-config.yml`:

<RepositoryBlueprint/>

<TagBlueprint/>

<ReleaseBlueprint/>

<RepositoryTagReleaseAppConfig/>

## Map supported resources

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ In organizations that have a self-hosted GitHub installation there is no access
- Contents: Readonly (for reading port configuration files and repository files).
- Metadata: Readonly.
- Pull Request: Readonly
- Deployments: Readonly
- Environments: Readonly
- **Organization Permissions:**
- Webhooks: Read and Write (to allow the integration create webhook).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ To create a personal access token see Github's [managing your personal access to
- **Content**: Readonly
- **Metadata**: Readonly
- **Pull Requests**: Readonly
- **Deployments**: Readonly
- **Environments**: Readonly

**Organization permissions:**
- **Webhooks**: Read and Write (for managing webhook)
Expand Down
Loading