Skip to content

Commit

Permalink
fix: only publish port for backend
Browse files Browse the repository at this point in the history
  • Loading branch information
AngelOnFira committed Aug 15, 2024
1 parent 96ad611 commit 7bd9021
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions rivet-toolchain/src/backend/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pub struct BackendCommandOpts {
pub args: Vec<String>,
pub env: HashMap<String, String>,
pub cwd: PathBuf,
pub ports: Vec<(u16, u16)>,
}

#[derive(PartialEq, Serialize, Deserialize, Clone)]
Expand Down Expand Up @@ -82,6 +83,11 @@ pub async fn build_opengb_command(opts: BackendCommandOpts) -> GlobalResult<Comm
cmd.arg("--project");
cmd.arg(opts.config_path);
cmd.args(&opts.args);

for (host_port, container_port) in opts.ports {
cmd.arg(format!("--publish={}:{}", host_port, container_port));
}

Ok(cmd)
}
}
Expand Down
1 change: 1 addition & 0 deletions rivet-toolchain/src/tasks/backend_dev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ impl super::Task for Task {
args: vec!["dev".into(), "--force-deploy-migrations".into()],
env: cmd_env,
cwd: input.cwd.into(),
ports: vec![(input.port, input.port)],
},
)
.await?;
Expand Down
1 change: 1 addition & 0 deletions rivet-toolchain/src/tasks/backend_sdk_gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ impl super::Task for Task {
],
env: cmd_env,
cwd: input.cwd.into(),
ports: vec![],
},
)
.await?;
Expand Down

0 comments on commit 7bd9021

Please sign in to comment.