feat: support custom env variables (#1675)

* custom envs

* feat: custom envs

* only on non cloud

* remove unecessary imports
This commit is contained in:
Ruben Fiszel
2023-06-05 17:42:57 +02:00
committed by GitHub
parent 970a3c6dd3
commit 98e1fdd898
14 changed files with 199 additions and 76 deletions

View File

@@ -1,4 +1,4 @@
use std::process::Stdio;
use std::{collections::HashMap, process::Stdio};
use itertools::Itertools;
use regex::Regex;
@@ -165,6 +165,7 @@ pub async fn handle_python_job(
inner_content: &String,
shared_mount: &str,
base_internal_url: &str,
envs: HashMap<String, String>,
) -> windmill_common::error::Result<serde_json::Value> {
create_dependencies_dir(job_dir).await;
@@ -435,6 +436,7 @@ mount {{
Command::new(PYTHON_PATH.as_str())
.current_dir(job_dir)
.env_clear()
.envs(envs)
.envs(reserved_variables)
.env("PATH", PATH_ENV.as_str())
.env("BASE_INTERNAL_URL", base_internal_url)