Skip to main content

environment_staged_changes

Creates, updates, deletes, gets or lists an environment_staged_changes resource.

Overview​

Nameenvironment_staged_changes
TypeResource
Idrailway.environments.environment_staged_changes

Fields​

The following fields are returned by SELECT queries:

One EnvironmentPatch row.

NameDatatypeDescription
idstring
environment_idstring
applied_atstring (date-time)
applied_byobjectAppliedByMember object
created_atstring (date-time)
last_applied_errorstring
messagestring
patchobject
statusstring (APPLYING, COMMITTED, FAILED, STAGED)
updated_atstring (date-time)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectenvironment_idGet the latest staged commit for a single environment. Backed by the Railway GraphQL query environmentStagedChanges.
commitexecenvironment_idcommit_message, skip_deploysCommits the staged changes for a single environment. Backed by the Railway GraphQL mutation environmentPatchCommitStaged.
stageexecenvironment_id, inputmergeSets the staged patch for a single environment. Backed by the Railway GraphQL mutation environmentStageChanges.

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.

NameDatatypeDescription
environment_idstring
commit_messagestring
inputobject
mergestringMerge the input patch into the existing staged patch. Boolean passed as a string, for example 'true'.
skip_deploysstringSkip deploys for services affected by this patch. Boolean passed as a string, for example 'true'.

SELECT examples​

Get the latest staged commit for a single environment. Backed by the Railway GraphQL query environmentStagedChanges.

SELECT
id,
environment_id,
applied_at,
applied_by,
created_at,
last_applied_error,
message,
patch,
status,
updated_at
FROM railway.environments.environment_staged_changes
WHERE environment_id = '{{ environment_id }}' -- required
;

Lifecycle Methods​

Commits the staged changes for a single environment. Backed by the Railway GraphQL mutation environmentPatchCommitStaged.

EXEC railway.environments.environment_staged_changes.commit
@environment_id='{{ environment_id }}', --required
@commit_message='{{ commit_message }}',
@skip_deploys='{{ skip_deploys }}'
;