allow skipping deploys when setting variables (#646)

This commit is contained in:
Faraz Patankar 2025-07-29 11:02:36 +04:00 committed by GitHub
parent f1841c2a0a
commit 4f8fb927a4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 2949 additions and 653 deletions

View file

@ -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)

View file

@ -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?;

View file

@ -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}
)
}
}

File diff suppressed because it is too large Load diff