File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
src/main/groovy/com/avast/gradle/dockercompose/tasks Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,8 @@ class ComposeUp extends DefaultTask {
5757 }
5858
5959 protected void captureContainersOutput () {
60+ // execute daemon thread that executes `docker-compose logs -f --no-color`
61+ // the -f arguments means `follow` and so this command ends when docker-compose finishes
6062 def t = Executors . defaultThreadFactory(). newThread(new Runnable () {
6163 @Override
6264 void run () {
@@ -66,8 +68,10 @@ class ComposeUp extends DefaultTask {
6668 def buffer = new ArrayList<Byte > ()
6769 @Override
6870 void write (int b ) throws IOException {
71+ // store bytes into buffer until end-of-line character is detected
6972 if (b == 10 || b == 13 ) {
7073 if (buffer. size() > 0 ) {
74+ // convert the byte buffer to characters and print these characters
7175 def toPrint = buffer. collect { it as byte }. toArray() as byte []
7276 logger. lifecycle(new String (toPrint))
7377 buffer. clear()
You can’t perform that action at this time.
0 commit comments