mirror of
https://codeberg.org/icewind/haze.git
synced 2026-06-03 17:14:08 +02:00
autosetup
This commit is contained in:
parent
fadc4e14d0
commit
222c500e5c
3 changed files with 84 additions and 2 deletions
41
src/main.rs
41
src/main.rs
|
|
@ -52,6 +52,37 @@ async fn main() -> Result<()> {
|
|||
HazeArgs::Start { options } => {
|
||||
let cloud = Cloud::create(&mut docker, options, &config).await?;
|
||||
println!("http://{}", cloud.ip.unwrap());
|
||||
if config.auto_setup.enabled {
|
||||
println!("Waiting for servers to start");
|
||||
cloud.wait_for_start(&mut docker).await?;
|
||||
println!(
|
||||
"Installing with username {} and password {}",
|
||||
config.auto_setup.username, config.auto_setup.password
|
||||
);
|
||||
cloud
|
||||
.exec(
|
||||
&mut docker,
|
||||
vec![
|
||||
"install",
|
||||
&config.auto_setup.username,
|
||||
&config.auto_setup.password,
|
||||
],
|
||||
false,
|
||||
)
|
||||
.await?;
|
||||
cloud
|
||||
.exec(
|
||||
&mut docker,
|
||||
vec![
|
||||
"sed",
|
||||
"-i",
|
||||
&format!("s/0 => 'localhost'/'{}'/", cloud.ip.unwrap()),
|
||||
"config/config.php",
|
||||
],
|
||||
false,
|
||||
)
|
||||
.await?;
|
||||
}
|
||||
}
|
||||
HazeArgs::Stop { filter } => {
|
||||
let cloud = Cloud::get_by_filter(&mut docker, filter, &config).await?;
|
||||
|
|
@ -103,7 +134,15 @@ async fn main() -> Result<()> {
|
|||
cloud.wait_for_start(&mut docker).await?;
|
||||
println!("Installing");
|
||||
cloud
|
||||
.exec(&mut docker, vec!["install", "admin", "admin"], false)
|
||||
.exec(
|
||||
&mut docker,
|
||||
vec![
|
||||
"install",
|
||||
&config.auto_setup.username,
|
||||
&config.auto_setup.password,
|
||||
],
|
||||
false,
|
||||
)
|
||||
.await?;
|
||||
if let Some(app) = path
|
||||
.as_ref()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue