mirror of
https://github.com/railwayapp/cli
synced 2026-04-21 14:07:23 +00:00
allow skipping deploys when setting variables (#646)
This commit is contained in:
parent
f1841c2a0a
commit
4f8fb927a4
4 changed files with 2949 additions and 653 deletions
|
|
@ -307,6 +307,7 @@ async fn upsert_variables(
|
|||
environment_id: env_id,
|
||||
service_id,
|
||||
variables,
|
||||
skip_deploys: None,
|
||||
};
|
||||
let _response =
|
||||
post_graphql::<mutations::VariableCollectionUpsert, _>(&client, backboard, vars)
|
||||
|
|
|
|||
|
|
@ -37,6 +37,10 @@ pub struct Args {
|
|||
/// Output in JSON format
|
||||
#[clap(long)]
|
||||
json: bool,
|
||||
|
||||
/// Skip triggering deploys when setting variables
|
||||
#[clap(long)]
|
||||
skip_deploys: bool,
|
||||
}
|
||||
|
||||
pub async fn command(args: Args) -> Result<()> {
|
||||
|
|
@ -78,6 +82,7 @@ pub async fn command(args: Args) -> Result<()> {
|
|||
service_id,
|
||||
&client,
|
||||
&configs,
|
||||
args.skip_deploys,
|
||||
)
|
||||
.await?;
|
||||
return Ok(());
|
||||
|
|
@ -131,6 +136,7 @@ async fn set_variables(
|
|||
service_id: String,
|
||||
client: &reqwest::Client,
|
||||
configs: &Configs,
|
||||
skip_deploys: bool,
|
||||
) -> Result<(), anyhow::Error> {
|
||||
let variables: BTreeMap<String, String> = set
|
||||
.iter()
|
||||
|
|
@ -164,6 +170,7 @@ async fn set_variables(
|
|||
environment_id,
|
||||
service_id,
|
||||
variables,
|
||||
skip_deploys: if skip_deploys { Some(true) } else { None },
|
||||
};
|
||||
post_graphql::<mutations::VariableCollectionUpsert, _>(client, configs.get_backboard(), vars)
|
||||
.await?;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
mutation VariableCollectionUpsert($projectId: String!, $serviceId: String!, $environmentId: String!, $variables: EnvironmentVariables!) {
|
||||
mutation VariableCollectionUpsert($projectId: String!, $serviceId: String!, $environmentId: String!, $variables: EnvironmentVariables!, $skipDeploys: Boolean) {
|
||||
variableCollectionUpsert(
|
||||
input: {projectId: $projectId, environmentId: $environmentId, serviceId: $serviceId, variables: $variables}
|
||||
input: {projectId: $projectId, environmentId: $environmentId, serviceId: $serviceId, variables: $variables, skipDeploys: $skipDeploys}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
3588
src/gql/schema.json
3588
src/gql/schema.json
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue