Fix for tests

This commit is contained in:
Romain GERARD
2022-03-17 11:57:18 +01:00
parent 2de28a8d84
commit fc9fe1b7e5
3 changed files with 20 additions and 6 deletions

8
Cargo.lock generated
View File

@@ -944,9 +944,9 @@ checksum = "f0a01e0497841a3b2db4f8afa483cce65f7e96a3498bd6c541734792aeac8fe7"
[[package]]
name = "git2"
version = "0.13.25"
version = "0.14.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f29229cc1b24c0e6062f6e742aa3e256492a5323365e5ed3413599f8a5eff7d6"
checksum = "3826a6e0e2215d7a41c2bfc7c9244123969273f3476b939a226aac0ab56e9e3c"
dependencies = [
"bitflags",
"libc",
@@ -1445,9 +1445,9 @@ checksum = "a7f823d141fe0a24df1e23b4af4e3c7ba9e5966ec514ea068c93024aa7deb765"
[[package]]
name = "libgit2-sys"
version = "0.12.26+1.3.0"
version = "0.13.2+1.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "19e1c899248e606fbfe68dcb31d8b0176ebab833b103824af31bddf4b7457494"
checksum = "3a42de9a51a5c12e00fc0e4ca6bc2ea43582fc6418488e8f615e905d886f258b"
dependencies = [
"cc",
"libc",

View File

@@ -9,7 +9,7 @@ edition = "2018"
[dependencies]
chrono = "0.4.19"
cmd_lib = "1.0.13"
git2 = "0.13.25"
git2 = "0.14.2"
walkdir = "2.3.2"
itertools = "0.10.0"
base64 = "0.13.0"

View File

@@ -2,8 +2,10 @@ use crate::cmd::command::{CommandError, QoveryCommand};
use crate::errors::EngineError;
use crate::events::EventDetails;
use chrono::Duration;
use std::env;
use std::path::Path;
use std::process::ExitStatus;
use std::time::{SystemTime, UNIX_EPOCH};
use url::Url;
#[derive(thiserror::Error, Debug)]
@@ -99,11 +101,23 @@ impl Docker {
// In order to be able to use --cache-from --cache-to for buildkit,
// we need to create our specific builder, which is not the default one (aka: the docker one)
let builder_name = if env::var_os("CI").is_some() {
format!(
"qovery-engine-{}",
SystemTime::now()
.duration_since(UNIX_EPOCH)
.expect("invalid timestamp")
.as_secs()
)
} else {
"qovery-engine".to_string()
};
let args = vec![
"buildx",
"create",
"--name",
"qovery-engine",
&builder_name,
"--driver-opt",
"network=host",
"--use",