(repo_id: String)
| 3 | use testcontainers::{Container, GenericImage}; |
| 4 | |
| 5 | pub fn init_git_server_testcontainer(repo_id: String) -> Container<GenericImage> { |
| 6 | // see https://github.com/rockstorm101/gitweb-docker |
| 7 | let container = GenericImage::new("rockstorm/gitweb", "2.43") |
| 8 | .with_exposed_port(80.tcp()) |
| 9 | .with_wait_for(WaitFor::message_on_stdout("Configuration complete; ready for start up")) |
| 10 | .start() |
| 11 | .expect("GitWeb Started"); |
| 12 | container |
| 13 | .exec(ExecCommand::new(vec![ |
| 14 | "sh", |
| 15 | "-c", |
| 16 | "echo -ne \"[safe]\n\tdirectory = *\" > /var/run/fcgiwrap/.gitconfig", |
| 17 | ])) |
| 18 | .expect("Created git config"); |
| 19 | container |
| 20 | .exec(ExecCommand::new(vec![ |
| 21 | "sh", |
| 22 | "-c", |
| 23 | format!( |
| 24 | "git clone -b basic-app-deploy https://github.com/Qovery/engine-testing.git /srv/git/{repo_id}.git" |
| 25 | ) |
| 26 | .as_str(), |
| 27 | ])) |
| 28 | .expect("Cloned repo"); |
| 29 | container |
| 30 | } |
no test coverage detected