Skip to content

Commit

Permalink
Support deploy token from environment
Browse files Browse the repository at this point in the history
  • Loading branch information
marlonbaeten committed Jun 14, 2024
1 parent e4985dc commit 3ff420f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/commands/project_deploy.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
use std::env;

use crate::commands::{compute_project_files, load_manifest, ProjectOpts};
use crate::error::{ErrorKind, Result};
use crate::project::types::EncryptionType;
use crate::util;

pub(crate) const DEPLOY_TOKEN_NAME: &str = "DEPLOY_TOKEN";

pub fn exec(
opts: ProjectOpts,
kubeconfig: Option<std::path::PathBuf>,
Expand All @@ -21,7 +25,13 @@ pub fn exec(
)
.context(ErrorKind::TokenError)?,
),
None => None,
None => {
if let Some(token) = env::var(DEPLOY_TOKEN_NAME).ok() {
Some(token)
} else {
None
}
}
};

let loaded_manifest = load_manifest(&opts)?;
Expand Down

0 comments on commit 3ff420f

Please sign in to comment.