Skip to content

Commit

Permalink
Improve docker-compose.yaml validation with this one small trick (#1084)
Browse files Browse the repository at this point in the history
  • Loading branch information
rukai committed Mar 17, 2023
1 parent 218211d commit 1ed2bdf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test-helpers/src/docker_compose.rs
Expand Up @@ -76,12 +76,14 @@ impl DockerCompose {
panic!("Could not find docker-compose. Have you installed it?");
}

// It is critical that clean_up is run before everything else as the internal `docker-compose` commands act as validation
// for the docker-compose.yaml file that we later manually parse with poor error handling
DockerCompose::clean_up(file_path).unwrap();

let service_to_image = DockerCompose::get_service_to_image(file_path);

DockerCompose::build_images(&service_to_image);

DockerCompose::clean_up(file_path).unwrap();

run_command("docker-compose", &["-f", file_path, "up", "-d"]).unwrap();

DockerCompose::wait_for_containers_to_startup(service_to_image, file_path);
Expand Down

0 comments on commit 1ed2bdf

Please sign in to comment.