environment_patches
Creates, updates, deletes, gets or lists an environment_patches resource.
Overview​
| Name | environment_patches |
| Type | Resource |
| Id | railway.environments.environment_patches |
Fields​
The following fields are returned by SELECT queries:
- get
- list
One EnvironmentPatch row.
| Name | Datatype | Description |
|---|---|---|
id | string | |
environment_id | string | |
applied_at | string (date-time) | |
applied_by | object | AppliedByMember object |
created_at | string (date-time) | |
last_applied_error | string | |
message | string | |
patch | object | |
status | string | (APPLYING, COMMITTED, FAILED, STAGED) |
updated_at | string (date-time) |
One row per EnvironmentPatch.
| Name | Datatype | Description |
|---|---|---|
id | string | |
environment_id | string | |
applied_at | string (date-time) | |
applied_by | object | AppliedByMember object |
created_at | string (date-time) | |
last_applied_error | string | |
message | string | |
patch | object | |
status | string | (APPLYING, COMMITTED, FAILED, STAGED) |
updated_at | string (date-time) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | id | Get a single environment patch by ID. Backed by the Railway GraphQL query environmentPatch. | |
list | select | environment_id | Get the patches for an environment. Backed by the Railway GraphQL query environmentPatches. | |
commit | exec | environment_id | commit_message, patch, skip_deploys | Commit the provided patch to the environment. Backed by the Railway GraphQL mutation environmentPatchCommit. |
restage | exec | patch_id | Copy a FAILED patch's changes into the environment's staged patch (creating one if needed). The FAILED patch is left untouched. Backed by the Railway GraphQL mutation environmentPatchRestage. |
Parameters​
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
environment_id | string | |
id | string | |
commit_message | string | |
patch | object | |
patch_id | string | |
skip_deploys | string | Skip deploys for services affected by this patch. Boolean passed as a string, for example 'true'. |
SELECT examples​
- get
- list
Get a single environment patch by ID. Backed by the Railway GraphQL query environmentPatch.
SELECT
id,
environment_id,
applied_at,
applied_by,
created_at,
last_applied_error,
message,
patch,
status,
updated_at
FROM railway.environments.environment_patches
WHERE id = '{{ id }}' -- required
;
Get the patches for an environment. Backed by the Railway GraphQL query environmentPatches.
SELECT
id,
environment_id,
applied_at,
applied_by,
created_at,
last_applied_error,
message,
patch,
status,
updated_at
FROM railway.environments.environment_patches
WHERE environment_id = '{{ environment_id }}' -- required
;
Lifecycle Methods​
- commit
- restage
Commit the provided patch to the environment. Backed by the Railway GraphQL mutation environmentPatchCommit.
EXEC railway.environments.environment_patches.commit
@environment_id='{{ environment_id }}', --required
@commit_message='{{ commit_message }}',
@patch='{{ patch }}',
@skip_deploys='{{ skip_deploys }}'
;
Copy a FAILED patch's changes into the environment's staged patch (creating one if needed). The FAILED patch is left untouched. Backed by the Railway GraphQL mutation environmentPatchRestage.
EXEC railway.environments.environment_patches.restage
@patch_id='{{ patch_id }}' --required
;