Skip to content

Commit

Permalink
Output to stdout/stderr while docker-compose process is running (#482)
Browse files Browse the repository at this point in the history
Ensure the progress of `docker-compose up` is printing to stderr/stdout to prevent circle context deadlines being hit when pulling a large number of containers..
  • Loading branch information
CRogers authored Sep 29, 2021
1 parent e43f96f commit ef580ce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions changelog/@unreleased/pr-482.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type: fix
fix:
description: Ensure the progress of `docker-compose up` is printing to stderr/stdout
to prevent circle context deadlines being hit when pulling a large number of containers..
links:
- https://github.com/palantir/gradle-docker/pull/482
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import org.apache.tools.ant.util.TeeOutputStream;
import org.gradle.api.Action;
import org.gradle.api.GradleException;
import org.gradle.api.Project;
Expand All @@ -34,8 +35,8 @@ public static void execWithErrorMessage(Project project, Action<ExecSpec> execSp
ExecResult execResult = project.exec(execSpec -> {
execSpecAction.execute(execSpec);
execSpec.setIgnoreExitValue(true);
execSpec.setStandardOutput(output);
execSpec.setErrorOutput(output);
execSpec.setStandardOutput(new TeeOutputStream(System.out, output));
execSpec.setErrorOutput(new TeeOutputStream(System.err, output));
commandLine.addAll(execSpec.getCommandLine());
});

Expand Down

0 comments on commit ef580ce

Please sign in to comment.