mirror of
https://github.com/serai-dex/serai.git
synced 2025-01-03 09:29:46 +00:00
Print docker build
This commit is contained in:
parent
1af5f1bcdc
commit
42eb674d1a
1 changed files with 23 additions and 3 deletions
|
@ -117,6 +117,23 @@ pub fn build(name: String) {
|
|||
|
||||
println!("Building {}...", &name);
|
||||
|
||||
// Version which always prints
|
||||
if !Command::new("docker")
|
||||
.current_dir(deploy_path)
|
||||
.arg("compose")
|
||||
.arg("build")
|
||||
.arg(&name)
|
||||
.spawn()
|
||||
.unwrap()
|
||||
.wait()
|
||||
.unwrap()
|
||||
.success()
|
||||
{
|
||||
panic!("failed to build {name}");
|
||||
}
|
||||
|
||||
// Version which only prints on error
|
||||
/*
|
||||
let res = Command::new("docker")
|
||||
.current_dir(deploy_path)
|
||||
.arg("compose")
|
||||
|
@ -140,19 +157,22 @@ pub fn build(name: String) {
|
|||
);
|
||||
panic!("failed to build {name}");
|
||||
}
|
||||
*/
|
||||
|
||||
println!("Built!");
|
||||
|
||||
if std::env::var("GITHUB_CI").is_ok() {
|
||||
println!("In CI, so clearing cache to prevent hitting the storage limits.");
|
||||
Command::new("docker")
|
||||
if !Command::new("docker")
|
||||
.arg("builder")
|
||||
.arg("prune")
|
||||
.arg("--all")
|
||||
.arg("--force")
|
||||
.output()
|
||||
.unwrap();
|
||||
if !res.status.success() {
|
||||
.unwrap()
|
||||
.status
|
||||
.success()
|
||||
{
|
||||
println!("failed to clear cache after building {name}\n");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue