Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crates/tower-cmd/src/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ where

env_vars.insert("TOWER_JWT".to_string(), session.token.jwt.to_string());
env_vars.insert("TOWER__RUNTIME__IS_LOCAL".to_string(), "true".to_string());
env_vars.insert("TOWER_ENVIRONMENT".to_string(), env.to_string());

// Load the Towerfile
let towerfile_path = path.join("Towerfile");
Expand Down
14 changes: 0 additions & 14 deletions crates/tower-runtime/src/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ async fn inner_execute_local_app(
) -> Result<i32, Error> {
let ctx = opts.ctx.clone();
let package = opts.package;
let environment = opts.environment;
let package_path = package.unpacked_path.clone().unwrap().to_path_buf();

// set for later on.
Expand Down Expand Up @@ -186,7 +185,6 @@ async fn inner_execute_local_app(
if is_bash_package(&package) {
let child = execute_bash_program(
&ctx,
&environment,
working_dir,
package_path,
&manifest,
Expand All @@ -212,7 +210,6 @@ async fn inner_execute_local_app(
let uv = Uv::new(opts.cache_dir, protected_mode).await?;
let env_vars = make_env_vars(
&ctx,
&environment,
&package_path,
&secrets,
&params,
Expand Down Expand Up @@ -475,7 +472,6 @@ impl App for LocalApp {

async fn execute_bash_program(
ctx: &tower_telemetry::Context,
env: &str,
cwd: PathBuf,
package_path: PathBuf,
manifest: &Manifest,
Expand All @@ -497,7 +493,6 @@ async fn execute_bash_program(
.stderr(Stdio::piped())
.envs(make_env_vars(
&ctx,
env,
&cwd,
&secrets,
&params,
Expand All @@ -524,7 +519,6 @@ fn make_env_var_key(src: &str) -> String {

fn make_env_vars(
ctx: &tower_telemetry::Context,
env: &str,
cwd: &PathBuf,
secs: &HashMap<String, String>,
params: &HashMap<String, String>,
Expand Down Expand Up @@ -566,14 +560,6 @@ fn make_env_vars(
.to_string();
res.insert("PYTHONPATH".to_string(), pythonpath);

// Inject a TOWER_ENVIRONMENT parameter so you know what environment you're running in. Empty
// environment is "default" by default.
if env.is_empty() {
res.insert("TOWER_ENVIRONMENT".to_string(), "default".to_string());
} else {
res.insert("TOWER_ENVIRONMENT".to_string(), env.to_string());
}

res.insert("PYTHONUNBUFFERED".to_string(), "x".to_string());

res
Expand Down
Loading