Skip to content

Commit

Permalink
Feat/re integrate platform api again (#993)
Browse files Browse the repository at this point in the history
* feat: Re-integrate platform API
  • Loading branch information
Santos92 authored Dec 2, 2024
1 parent 5082df5 commit 317fc77
Show file tree
Hide file tree
Showing 9 changed files with 771 additions and 505 deletions.
38 changes: 38 additions & 0 deletions cloud-deploy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,44 @@ service-hours: ## all times in UTC ( scale up at 07:00, scale down to 0 at 22:00
min-instances: ## the value the scaleup will use
region: ## unused but will be used once we roll out to more regions
```

Managed Cloud Run service with path-mappings

```yaml
cloud-run:
service: my-service
resources:
cpu: 1
memory: 512Mi
protocol: http
scaling:
concurrency: 80

environments:
production:
min-instances: 1
domain-mappings:
- my-service.retailsvc.com
- my-service.retailsvc-test.com
path-mappings:
- paths:
- /login/*
- /api/v2/*
- /api/beta/*
service: my-service-a
path-rewrite: /
- paths:
- /api/v3/*
service: my-service-b
```
```
service/bucket: ## An already existing service/bucket to target in the same project
paths: ## Paths to setup for this target
path-rewrite: ## Rewrite the path on the downstream service

example: my-service.retailsvc.com/api/v2/feature will hit my-service-a with my-service.retailsvc.com/feature
```
### Kubernetes deployment
A Kubernetes deployment with IAM security resources customized.
Expand Down
540 changes: 270 additions & 270 deletions cloud-deploy/dist/index.js

Large diffs are not rendered by default.

123 changes: 114 additions & 9 deletions cloud-deploy/schema_doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,16 @@
- [5.1.2. Property `CloudDeploy > environments > production > max-instances`](#environments_production_max-instances)
- [5.1.3. Property `CloudDeploy > environments > production > domain-mappings`](#environments_production_domain-mappings)
- [5.1.3.1. CloudDeploy > environments > production > domain-mappings > Domain](#autogenerated_heading_6)
- [5.1.4. Property `CloudDeploy > environments > production > env`](#environments_production_env)
- [5.1.4.1. Pattern Property `CloudDeploy > environments > production > env > EnvVar`](#environments_production_env_pattern1)
- [5.1.5. Property `CloudDeploy > environments > production > regions`](#environments_production_regions)
- [5.1.5.1. CloudDeploy > environments > production > regions > GoogleRegion](#autogenerated_heading_7)
- [5.1.4. Property `CloudDeploy > environments > production > path-mappings`](#environments_production_path-mappings)
- [5.1.4.1. CloudDeploy > environments > production > path-mappings > PathRule](#autogenerated_heading_7)
- [5.1.4.1.1. Property `CloudDeploy > environments > production > path-mappings > PathRule > oneOf`](#environments_production_path-mappings_items_oneOf)
- [5.1.4.1.2. Property `CloudDeploy > environments > production > path-mappings > PathRule > paths`](#environments_production_path-mappings_items_paths)
- [5.1.4.1.2.1. CloudDeploy > environments > production > path-mappings > PathRule > paths > path](#autogenerated_heading_8)
- [5.1.4.1.3. Property `CloudDeploy > environments > production > path-mappings > PathRule > path-rewrite`](#environments_production_path-mappings_items_path-rewrite)
- [5.1.5. Property `CloudDeploy > environments > production > env`](#environments_production_env)
- [5.1.5.1. Pattern Property `CloudDeploy > environments > production > env > EnvVar`](#environments_production_env_pattern1)
- [5.1.6. Property `CloudDeploy > environments > production > regions`](#environments_production_regions)
- [5.1.6.1. CloudDeploy > environments > production > regions > GoogleRegion](#autogenerated_heading_9)
- [5.2. Property `CloudDeploy > environments > staging`](#environments_staging)
- [5.2.1. Property `CloudDeploy > environments > staging > oneOf > StagingNone`](#environments_staging_oneOf_i0)
- [5.2.2. Property `CloudDeploy > environments > staging > oneOf > Environment`](#environments_staging_oneOf_i1)
Expand Down Expand Up @@ -1096,6 +1102,7 @@ must respect the following conditions
| + [min-instances](#environments_production_min-instances ) | No | integer | No | - | Minimum number of instances |
| - [max-instances](#environments_production_max-instances ) | No | integer | No | - | Maximum number of instances |
| - [domain-mappings](#environments_production_domain-mappings ) | No | array of string | No | - | DomainMappings |
| - [path-mappings](#environments_production_path-mappings ) | No | array of object | No | - | PathMappings |
| - [env](#environments_production_env ) | No | object | No | - | EnvVars |
| - [regions](#environments_production_regions ) | No | array of string | No | - | Regions |

Expand Down Expand Up @@ -1162,7 +1169,105 @@ must respect the following conditions

**Description:** Fully qualified domain name

#### <a name="environments_production_env"></a>5.1.4. Property `CloudDeploy > environments > production > env`
#### <a name="environments_production_path-mappings"></a>5.1.4. Property `CloudDeploy > environments > production > path-mappings`

**Title:** PathMappings

| | |
| ------------ | ----------------- |
| **Type** | `array of object` |
| **Required** | No |

**Description:** Service path mappings

| | Array restrictions |
| -------------------- | ------------------ |
| **Min items** | N/A |
| **Max items** | N/A |
| **Items unicity** | False |
| **Additional items** | False |
| **Tuple validation** | See below |

| Each item of this array must be | Description |
| -------------------------------------------------------- | ----------- |
| [PathRule](#environments_production_path-mappings_items) | PathRules |

##### <a name="autogenerated_heading_7"></a>5.1.4.1. CloudDeploy > environments > production > path-mappings > PathRule

**Title:** PathRule

| | |
| ------------------------- | ------------------------------------------------------------------------- |
| **Type** | `object` |
| **Required** | No |
| **Additional properties** | [[Any type: allowed]](# "Additional Properties of any type are allowed.") |

**Description:** PathRules

| Property | Pattern | Type | Deprecated | Definition | Title/Description |
| ---------------------------------------------------------------------------- | ------- | --------------- | ---------- | ---------- | ----------------- |
| - [oneOf](#environments_production_path-mappings_items_oneOf ) | No | object | No | - | - |
| - [paths](#environments_production_path-mappings_items_paths ) | No | array of string | No | - | Paths |
| - [path-rewrite](#environments_production_path-mappings_items_path-rewrite ) | No | string | No | - | Path rewrite |

##### <a name="environments_production_path-mappings_items_oneOf"></a>5.1.4.1.1. Property `CloudDeploy > environments > production > path-mappings > PathRule > oneOf`

| | |
| ------------------------- | ------------------------------------------------------------------------- |
| **Type** | `object` |
| **Required** | No |
| **Additional properties** | [[Any type: allowed]](# "Additional Properties of any type are allowed.") |

##### <a name="environments_production_path-mappings_items_paths"></a>5.1.4.1.2. Property `CloudDeploy > environments > production > path-mappings > PathRule > paths`

**Title:** Paths

| | |
| ------------ | ----------------- |
| **Type** | `array of string` |
| **Required** | No |

**Description:** Target paths

| | Array restrictions |
| -------------------- | ------------------ |
| **Min items** | N/A |
| **Max items** | N/A |
| **Items unicity** | False |
| **Additional items** | False |
| **Tuple validation** | See below |

| Each item of this array must be | Description |
| ---------------------------------------------------------------- | -------------------- |
| [path](#environments_production_path-mappings_items_paths_items) | Fully qualified path |

##### <a name="autogenerated_heading_8"></a>5.1.4.1.2.1. CloudDeploy > environments > production > path-mappings > PathRule > paths > path

**Title:** path

| | |
| ------------ | -------- |
| **Type** | `string` |
| **Required** | No |

**Description:** Fully qualified path

| Restrictions | |
| --------------------------------- | --------------------------------------------------------------------- |
| **Must match regular expression** | ```^/(.*)$``` [Test](https://regex101.com/?regex=%5E%2F%28.%2A%29%24) |

##### <a name="environments_production_path-mappings_items_path-rewrite"></a>5.1.4.1.3. Property `CloudDeploy > environments > production > path-mappings > PathRule > path-rewrite`

**Title:** Path rewrite

| | |
| ------------ | -------- |
| **Type** | `string` |
| **Required** | No |

**Description:** The path prefix that will be used on the target service

#### <a name="environments_production_env"></a>5.1.5. Property `CloudDeploy > environments > production > env`

**Title:** EnvVars

Expand All @@ -1178,7 +1283,7 @@ must respect the following conditions
| -------------------------------------------------------- | ------- | ------ | ---------- | ---------- | ----------------- |
| - [^[A-Z0-9_]+$](#environments_production_env_pattern1 ) | Yes | string | No | - | EnvVar |

##### <a name="environments_production_env_pattern1"></a>5.1.4.1. Pattern Property `CloudDeploy > environments > production > env > EnvVar`
##### <a name="environments_production_env_pattern1"></a>5.1.5.1. Pattern Property `CloudDeploy > environments > production > env > EnvVar`
> All properties whose name matches the regular expression
```^[A-Z0-9_]+$``` ([Test](https://regex101.com/?regex=%5E%5BA-Z0-9_%5D%2B%24))
must respect the following conditions
Expand All @@ -1190,7 +1295,7 @@ must respect the following conditions
| **Type** | `string` |
| **Required** | No |

#### <a name="environments_production_regions"></a>5.1.5. Property `CloudDeploy > environments > production > regions`
#### <a name="environments_production_regions"></a>5.1.6. Property `CloudDeploy > environments > production > regions`

**Title:** Regions

Expand All @@ -1213,7 +1318,7 @@ must respect the following conditions
| ------------------------------------------------------ | ---------------------------------------- |
| [GoogleRegion](#environments_production_regions_items) | A Google Cloud region, e.g. europe-west1 |

##### <a name="autogenerated_heading_7"></a>5.1.5.1. CloudDeploy > environments > production > regions > GoogleRegion
##### <a name="autogenerated_heading_9"></a>5.1.6.1. CloudDeploy > environments > production > regions > GoogleRegion

**Title:** GoogleRegion

Expand Down Expand Up @@ -1262,4 +1367,4 @@ must respect the following conditions
**Description:** A deploy environment

----------------------------------------------------------------------------------------------------------------------------
Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2024-08-05 at 15:56:24 +0200
Generated using [json-schema-for-humans](https://github.com/coveooss/json-schema-for-humans) on 2024-10-01 at 11:19:31 +0200
Loading

0 comments on commit 317fc77

Please sign in to comment.