Explicitly pass DOMAIN_SUFFIX and CADDY_API_URL to build script
Environment inheritance from the server process was not reliably propagating these vars into the spawned bash subprocess. https://claude.ai/code/session_01FKCW3FDjNFj6jve4niMFXH
This commit is contained in:
parent
f92545ed4e
commit
ee78f3ff0a
1 changed files with 13 additions and 8 deletions
|
|
@ -118,16 +118,21 @@ async fn run_build(state: &AppState, deploy_id: &str) -> anyhow::Result<()> {
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
|
let domain_suffix = std::env::var("DOMAIN_SUFFIX").unwrap_or_else(|_| "localhost".into());
|
||||||
|
let caddy_api_url = std::env::var("CADDY_API_URL").unwrap_or_else(|_| "http://localhost:2019".into());
|
||||||
|
|
||||||
let mut child = Command::new("bash")
|
let mut child = Command::new("bash")
|
||||||
.arg(&build_script)
|
.arg(&build_script)
|
||||||
.env("APP_ID", &app.id)
|
.env("APP_ID", &app.id)
|
||||||
.env("APP_NAME", &app.name)
|
.env("APP_NAME", &app.name)
|
||||||
.env("REPO_URL", &app.repo_url)
|
.env("REPO_URL", &app.repo_url)
|
||||||
.env("BRANCH", &app.branch)
|
.env("BRANCH", &app.branch)
|
||||||
.env("PORT", app.port.to_string())
|
.env("PORT", app.port.to_string())
|
||||||
.env("ENV_FILE", &env_file)
|
.env("ENV_FILE", &env_file)
|
||||||
.env("SHA", deploy.sha.as_deref().unwrap_or(""))
|
.env("SHA", deploy.sha.as_deref().unwrap_or(""))
|
||||||
.env("BUILD_DIR", &build_dir)
|
.env("BUILD_DIR", &build_dir)
|
||||||
|
.env("DOMAIN_SUFFIX", &domain_suffix)
|
||||||
|
.env("CADDY_API_URL", &caddy_api_url)
|
||||||
.stdout(std::process::Stdio::piped())
|
.stdout(std::process::Stdio::piped())
|
||||||
.stderr(std::process::Stdio::piped())
|
.stderr(std::process::Stdio::piped())
|
||||||
.spawn()
|
.spawn()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue