Skip to content

Commit

Permalink
fix(mongodb): use python 3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
tsirysndr committed Jul 15, 2024
1 parent 1ad0fee commit aa74310
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion mongodb/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pub fn setup() -> Result<String, Error> {
let mongodb_data_dir = dag().get_env("MONGODB_DATA_DIR")?;
let mongodb_port = dag().get_env("MONGODB_PORT")?;
let mongodb_args = dag().get_env("MONGODB_ARGS")?;
let mongodb_version = dag().get_env("MONGODB_VERSION")?;

if mongodb_data_dir.is_empty() {
dag().set_envs(vec![("MONGODB_DATA_DIR".into(), "./data".into())])?;
Expand All @@ -36,14 +37,20 @@ pub fn setup() -> Result<String, Error> {
dag().set_envs(vec![("MONGODB_ARGS".into(), "--noauth".into())])?;
}

if mongodb_version.is_empty() {
dag().set_envs(vec![("MONGODB_VERSION".into(), "6.0".into())])?;
}

let mongodb_version = dag().get_env("MONGODB_VERSION")?.replace(".", "_");

let stdout = dag()
.flox()?
.with_workdir(".fluentci")?
.with_exec(vec![
"[ -d $MONGODB_DATA_DIR ] || mkdir -p $MONGODB_DATA_DIR",
])?
.with_exec(vec![
"flox", "install", "mongodb", "mongosh", "overmind", "tmux",
"flox", "install", &format!("mongodb-{}", mongodb_version), "mongosh", "mongodb-tools", "python311", "overmind", "tmux",
])?
.with_exec(vec![
"grep -q mongodb Procfile || echo 'mongodb: mongod -dbpath $MONGODB_DATA_DIR --port $MONGODB_PORT $MONGODB_ARGS' >> Procfile",
Expand Down

0 comments on commit aa74310

Please sign in to comment.