Skip to content

Commit

Permalink
chore: ビルド開始時と終了時にログを出力
Browse files Browse the repository at this point in the history
  • Loading branch information
rito528 committed Mar 26, 2024
1 parent 76676a7 commit 89dc79c
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,39 +64,42 @@ mod infra_repository_impls {

impl BuildHandler for BuildRepository {
async fn run_stable_build(&self) -> anyhow::Result<()> {
println!("a");
switch_branch(Branch::Master).await?;
println!("b");
let sbt_compile_log = Command::new("sbt")

tracing::info!("Building SeichiAssist(stable)...");

Command::new("sbt")
.arg("assembly")
.current_dir("/SeichiAssist")
.output()?;
println!("{:?}", sbt_compile_log);
println!("c");

tracing::info!("Build completed.");

if !Path::new(STABLE_BUILD_DIR_PATH).is_dir() {
fs::create_dir(STABLE_BUILD_DIR_PATH)?;
}
println!("d");

if Path::new(STABLE_BUILD_FILE_PATH).is_file() {
fs::remove_file(STABLE_BUILD_FILE_PATH)?;
}
println!("e");

fs::rename(BUILD_ARTIFACT_PATH, STABLE_BUILD_FILE_PATH)?;
println!("f");

Ok(())
}

async fn run_develop_build(&self) -> anyhow::Result<()> {
switch_branch(Branch::Develop).await?;

tracing::info!("Building SeichiAssist(develop)...");

Command::new("sbt")
.arg("assembly")
.current_dir("/SeichiAssist")
.status()?;

tracing::info!("Build completed.");

if !Path::new(DEVELOP_BUILD_DIR_PATH).is_dir() {
fs::create_dir(DEVELOP_BUILD_DIR_PATH)?;
}
Expand Down

0 comments on commit 89dc79c

Please sign in to comment.