mirror of
https://github.com/serai-dex/serai.git
synced 2025-01-03 17:40:34 +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);
|
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")
|
let res = Command::new("docker")
|
||||||
.current_dir(deploy_path)
|
.current_dir(deploy_path)
|
||||||
.arg("compose")
|
.arg("compose")
|
||||||
|
@ -140,19 +157,22 @@ pub fn build(name: String) {
|
||||||
);
|
);
|
||||||
panic!("failed to build {name}");
|
panic!("failed to build {name}");
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
println!("Built!");
|
println!("Built!");
|
||||||
|
|
||||||
if std::env::var("GITHUB_CI").is_ok() {
|
if std::env::var("GITHUB_CI").is_ok() {
|
||||||
println!("In CI, so clearing cache to prevent hitting the storage limits.");
|
println!("In CI, so clearing cache to prevent hitting the storage limits.");
|
||||||
Command::new("docker")
|
if !Command::new("docker")
|
||||||
.arg("builder")
|
.arg("builder")
|
||||||
.arg("prune")
|
.arg("prune")
|
||||||
.arg("--all")
|
.arg("--all")
|
||||||
.arg("--force")
|
.arg("--force")
|
||||||
.output()
|
.output()
|
||||||
.unwrap();
|
.unwrap()
|
||||||
if !res.status.success() {
|
.status
|
||||||
|
.success()
|
||||||
|
{
|
||||||
println!("failed to clear cache after building {name}\n");
|
println!("failed to clear cache after building {name}\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue