pageserver - remove env variables

Use CLI args instead of environment variables to parameterize the
working directory and postgres distirbution.

Before this change, there was a mixture of environment variables and CLI
arguments that needed to be set. Moving to a single input simplifies
cloud configuration management.
This commit is contained in:
Patrick Insinger
2021-06-11 16:58:18 -07:00
committed by Patrick Insinger
parent 9af04b3b8d
commit 77366b7a76
2 changed files with 27 additions and 32 deletions

View File

@@ -44,14 +44,15 @@ impl PageServerNode {
pub fn init(&self) -> Result<()> {
let mut cmd = Command::new(self.env.pageserver_bin()?);
let status = cmd
.args(&["--init", "-D", self.env.base_data_dir.to_str().unwrap()])
.args(&[
"--init",
"-D",
self.env.base_data_dir.to_str().unwrap(),
"--postgres-distrib",
self.env.pg_distrib_dir.to_str().unwrap(),
])
.env_clear()
.env("RUST_BACKTRACE", "1")
.env(
"POSTGRES_DISTRIB_DIR",
self.env.pg_distrib_dir.to_str().unwrap(),
)
.env("ZENITH_REPO_DIR", self.repo_path())
.status()
.expect("pageserver init failed");
@@ -83,15 +84,12 @@ impl PageServerNode {
self.address().to_string().as_str(),
"-D",
self.repo_path().to_str().unwrap(),
"--postgres-distrib",
self.env.pg_distrib_dir.to_str().unwrap(),
])
.arg("-d")
.env_clear()
.env("RUST_BACKTRACE", "1")
.env(
"POSTGRES_DISTRIB_DIR",
self.env.pg_distrib_dir.to_str().unwrap(),
)
.env("ZENITH_REPO_DIR", self.repo_path());
.env("RUST_BACKTRACE", "1");
if !cmd.status()?.success() {
bail!(