jimzucker / github-webhooks

Framework and Docker Container for running Webhooks on your GitHub repo.
MIT License
0 stars 1 forks source link

Ruby puts not showing in docker logs #6

Closed jimzucker closed 4 years ago

jimzucker commented 4 years ago

I noticed when running in detached mode the docker logs do not show the puts output.

Reading this seems to be a buffering issue.

sinatra/sinatra#1118

jimzucker commented 4 years ago

adding $stdout.sync = true as described in the Sinatra ticket worked.

Test 1 - New repo initialized with README.md

➜ git-webhooks git:(master) ✗ docker run --rm -ti -p 4567:4567 -v $PWD/.webhook_properties:/usr/src/app/.webhook_properties \ --name github-webhooks jimzucker/github-webhooks:latest

[2020-02-10 15:55:19] INFO WEBrick 1.4.2 [2020-02-10 15:55:19] INFO ruby 2.6.5 (2019-10-01) [x86_64-linux] == Sinatra (v2.0.8.1) has taken the stage on 4567 for development with backup from WEBrick [2020-02-10 15:55:19] INFO WEBrick::HTTPServer#start: pid=1 port=4567 [INFO] Ignoring object = label, action = created 140.82.115.247 - - [10/Feb/2020:15:55:46 +0000] "POST /github_webhook HTTP/1.1" 200 - 0.0037 172.17.0.1 - - [10/Feb/2020:15:55:46 UTC] "POST /github_webhook HTTP/1.1" 200 0


Test 2 - New repo NOT initialized with README.md

[INFO] Ignoring object = label, action = created 192.30.252.91 - - [10/Feb/2020:15:57:30 +0000] "POST /github_webhook HTTP/1.1" 200 - 0.0011 172.17.0.1 - - [10/Feb/2020:15:57:30 UTC] "POST /github_webhook HTTP/1.1" 200 0