{"action":"created","comment":{"url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/pulls/comments/65185285","id":65185285,"diff_hunk":"@@ -0,0 +1,68 @@\n+#!/bin/bash\n+\n+set -e\n+\n+DOCKER_TIMEOUT=20 # Wait 20 seconds for docker to start\n+\n+cleanup() {\n+    echo \"[INFO] Running cleanup...\"\n+\n+    # Stop docker gracefully\n+    echo \"[INFO] Stopping in container docker...\"\n+    DOCKERPIDFILE=/var/run/docker.pid\n+    if [ -f $DOCKERPIDFILE ] && [ -s $DOCKERPIDFILE ] && ps $(cat $DOCKERPIDFILE) | grep -q docker; then\n+        kill $(cat $DOCKERPIDFILE)\n+        # Now wait for it to die\n+        STARTTIME=$(date +%s)\n+        ENDTIME=$(date +%s)\n+        while [ -f $DOCKERPIDFILE ] && [ -s $DOCKERPIDFILE ] && ps $(cat $DOCKERPIDFILE) | grep -q docker; do\n+            if [ $(($ENDTIME - $STARTTIME)) -le $DOCKER_TIMEOUT ]; then\n+                sleep 1\n+                ENDTIME=$(date +%s)\n+            else\n+                echo \"[ERROR] Timeout while waiting for in container docker to die.\"\n+                exit 1\n+            fi\n+        done\n+    else\n+        echo \"[WARN] Can't stop docker container.\"\n+        echo \"[WARN] Your host might have been left with unreleased resources (ex. loop devices).\"\n+    fi\n+\n+    if [ \"$1\" == \"fail\" ]; then\n+        exit 1\n+    fi\n+}\n+trap 'cleanup fail' SIGINT SIGTERM\n+\n+# Create the normal user to be used for bitbake (barys)\n+echo \"[INFO] Creating and setting builder user $BUILDER_UID:$BUILDER_GID.\"\n+groupadd docker\n+groupadd -g $BUILDER_GID builder\n+useradd -m -u $BUILDER_UID -g $BUILDER_GID -G docker builder\n+\n+# Start docker\n+echo \"[INFO] Starting docker.\"\n+docker daemon 2> /dev/null &\n+echo \"[INFO] Waiting for docker to initialize...\"\n+STARTTIME=$(date +%s)\n+ENDTIME=$(date +%s)\n+until docker info >/dev/null 2>&1; do\n+    if [ $(($ENDTIME - $STARTTIME)) -le $DOCKER_TIMEOUT ]; then\n+        sleep 1\n+        ENDTIME=$(date +%s)","path":"automation/prepare-and-start.sh","position":53,"original_position":53,"commit_id":"f7d1b4e0e6dd7986d76a213602f5583dc157c048","original_commit_id":"77b4fc64c1f2de755615eb1b1e487d46f36b2d27","user":{"login":"floion","id":12278197,"avatar_url":"https://avatars.githubusercontent.com/u/12278197?v=3","gravatar_id":"","url":"https://api.github.com/users/floion","html_url":"https://github.com/floion","followers_url":"https://api.github.com/users/floion/followers","following_url":"https://api.github.com/users/floion/following{/other_user}","gists_url":"https://api.github.com/users/floion/gists{/gist_id}","starred_url":"https://api.github.com/users/floion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/floion/subscriptions","organizations_url":"https://api.github.com/users/floion/orgs","repos_url":"https://api.github.com/users/floion/repos","events_url":"https://api.github.com/users/floion/events{/privacy}","received_events_url":"https://api.github.com/users/floion/received_events","type":"User","site_admin":false},"body":"If you are fine with it, then this PR is LGTM","created_at":"2016-05-31T13:55:03Z","updated_at":"2016-05-31T13:55:03Z","html_url":"https://github.com/resin-os/resin-yocto-scripts/pull/17#discussion_r65185285","pull_request_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/pulls/17","_links":{"self":{"href":"https://api.github.com/repos/resin-os/resin-yocto-scripts/pulls/comments/65185285"},"html":{"href":"https://github.com/resin-os/resin-yocto-scripts/pull/17#discussion_r65185285"},"pull_request":{"href":"https://api.github.com/repos/resin-os/resin-yocto-scripts/pulls/17"}}},"pull_request":{"url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/pulls/17","id":71279564,"html_url":"https://github.com/resin-os/resin-yocto-scripts/pull/17","diff_url":"https://github.com/resin-os/resin-yocto-scripts/pull/17.diff","patch_url":"https://github.com/resin-os/resin-yocto-scripts/pull/17.patch","issue_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/issues/17","number":17,"state":"open","locked":false,"title":"Support for yocto builds in docker","user":{"login":"agherzan","id":1746941,"avatar_url":"https://avatars.githubusercontent.com/u/1746941?v=3","gravatar_id":"","url":"https://api.github.com/users/agherzan","html_url":"https://github.com/agherzan","followers_url":"https://api.github.com/users/agherzan/followers","following_url":"https://api.github.com/users/agherzan/following{/other_user}","gists_url":"https://api.github.com/users/agherzan/gists{/gist_id}","starred_url":"https://api.github.com/users/agherzan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agherzan/subscriptions","organizations_url":"https://api.github.com/users/agherzan/orgs","repos_url":"https://api.github.com/users/agherzan/repos","events_url":"https://api.github.com/users/agherzan/events{/privacy}","received_events_url":"https://api.github.com/users/agherzan/received_events","type":"User","site_admin":false},"body":"@floion @telphan @Page- @petrosagg ","created_at":"2016-05-24T19:35:46Z","updated_at":"2016-05-31T13:55:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"715957a0e6c82ca3dee1570ee838d3fea17d1eba","assignee":{"login":"agherzan","id":1746941,"avatar_url":"https://avatars.githubusercontent.com/u/1746941?v=3","gravatar_id":"","url":"https://api.github.com/users/agherzan","html_url":"https://github.com/agherzan","followers_url":"https://api.github.com/users/agherzan/followers","following_url":"https://api.github.com/users/agherzan/following{/other_user}","gists_url":"https://api.github.com/users/agherzan/gists{/gist_id}","starred_url":"https://api.github.com/users/agherzan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agherzan/subscriptions","organizations_url":"https://api.github.com/users/agherzan/orgs","repos_url":"https://api.github.com/users/agherzan/repos","events_url":"https://api.github.com/users/agherzan/events{/privacy}","received_events_url":"https://api.github.com/users/agherzan/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/pulls/17/commits","review_comments_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/pulls/17/comments","review_comment_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/pulls/comments{/number}","comments_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/issues/17/comments","statuses_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/statuses/f7d1b4e0e6dd7986d76a213602f5583dc157c048","head":{"label":"resin-os:yind","ref":"yind","sha":"f7d1b4e0e6dd7986d76a213602f5583dc157c048","user":{"login":"resin-os","id":16914061,"avatar_url":"https://avatars.githubusercontent.com/u/16914061?v=3","gravatar_id":"","url":"https://api.github.com/users/resin-os","html_url":"https://github.com/resin-os","followers_url":"https://api.github.com/users/resin-os/followers","following_url":"https://api.github.com/users/resin-os/following{/other_user}","gists_url":"https://api.github.com/users/resin-os/gists{/gist_id}","starred_url":"https://api.github.com/users/resin-os/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/resin-os/subscriptions","organizations_url":"https://api.github.com/users/resin-os/orgs","repos_url":"https://api.github.com/users/resin-os/repos","events_url":"https://api.github.com/users/resin-os/events{/privacy}","received_events_url":"https://api.github.com/users/resin-os/received_events","type":"Organization","site_admin":false},"repo":{"id":50602800,"name":"resin-yocto-scripts","full_name":"resin-os/resin-yocto-scripts","owner":{"login":"resin-os","id":16914061,"avatar_url":"https://avatars.githubusercontent.com/u/16914061?v=3","gravatar_id":"","url":"https://api.github.com/users/resin-os","html_url":"https://github.com/resin-os","followers_url":"https://api.github.com/users/resin-os/followers","following_url":"https://api.github.com/users/resin-os/following{/other_user}","gists_url":"https://api.github.com/users/resin-os/gists{/gist_id}","starred_url":"https://api.github.com/users/resin-os/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/resin-os/subscriptions","organizations_url":"https://api.github.com/users/resin-os/orgs","repos_url":"https://api.github.com/users/resin-os/repos","events_url":"https://api.github.com/users/resin-os/events{/privacy}","received_events_url":"https://api.github.com/users/resin-os/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/resin-os/resin-yocto-scripts","description":"Helper scripts for resin yocto builds","fork":false,"url":"https://api.github.com/repos/resin-os/resin-yocto-scripts","forks_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/forks","keys_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/keys{/key_id}","collaborators_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/teams","hooks_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/hooks","issue_events_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/issues/events{/number}","events_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/events","assignees_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/assignees{/user}","branches_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/branches{/branch}","tags_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/tags","blobs_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/git/refs{/sha}","trees_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/git/trees{/sha}","statuses_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/statuses/{sha}","languages_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/languages","stargazers_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/stargazers","contributors_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/contributors","subscribers_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/subscribers","subscription_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/subscription","commits_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/commits{/sha}","git_commits_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/git/commits{/sha}","comments_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/comments{/number}","issue_comment_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/issues/comments{/number}","contents_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/contents/{+path}","compare_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/compare/{base}...{head}","merges_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/merges","archive_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/downloads","issues_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/issues{/number}","pulls_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/pulls{/number}","milestones_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/milestones{/number}","notifications_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/labels{/name}","releases_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/releases{/id}","deployments_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/deployments","created_at":"2016-01-28T18:10:46Z","updated_at":"2016-01-28T19:48:32Z","pushed_at":"2016-05-31T11:24:46Z","git_url":"git://github.com/resin-os/resin-yocto-scripts.git","ssh_url":"git@github.com:resin-os/resin-yocto-scripts.git","clone_url":"https://github.com/resin-os/resin-yocto-scripts.git","svn_url":"https://github.com/resin-os/resin-yocto-scripts","homepage":"https://resin.io","size":124,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"resin-os:master","ref":"master","sha":"5b67a671686f8468de63726361195749801754d4","user":{"login":"resin-os","id":16914061,"avatar_url":"https://avatars.githubusercontent.com/u/16914061?v=3","gravatar_id":"","url":"https://api.github.com/users/resin-os","html_url":"https://github.com/resin-os","followers_url":"https://api.github.com/users/resin-os/followers","following_url":"https://api.github.com/users/resin-os/following{/other_user}","gists_url":"https://api.github.com/users/resin-os/gists{/gist_id}","starred_url":"https://api.github.com/users/resin-os/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/resin-os/subscriptions","organizations_url":"https://api.github.com/users/resin-os/orgs","repos_url":"https://api.github.com/users/resin-os/repos","events_url":"https://api.github.com/users/resin-os/events{/privacy}","received_events_url":"https://api.github.com/users/resin-os/received_events","type":"Organization","site_admin":false},"repo":{"id":50602800,"name":"resin-yocto-scripts","full_name":"resin-os/resin-yocto-scripts","owner":{"login":"resin-os","id":16914061,"avatar_url":"https://avatars.githubusercontent.com/u/16914061?v=3","gravatar_id":"","url":"https://api.github.com/users/resin-os","html_url":"https://github.com/resin-os","followers_url":"https://api.github.com/users/resin-os/followers","following_url":"https://api.github.com/users/resin-os/following{/other_user}","gists_url":"https://api.github.com/users/resin-os/gists{/gist_id}","starred_url":"https://api.github.com/users/resin-os/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/resin-os/subscriptions","organizations_url":"https://api.github.com/users/resin-os/orgs","repos_url":"https://api.github.com/users/resin-os/repos","events_url":"https://api.github.com/users/resin-os/events{/privacy}","received_events_url":"https://api.github.com/users/resin-os/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/resin-os/resin-yocto-scripts","description":"Helper scripts for resin yocto builds","fork":false,"url":"https://api.github.com/repos/resin-os/resin-yocto-scripts","forks_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/forks","keys_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/keys{/key_id}","collaborators_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/teams","hooks_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/hooks","issue_events_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/issues/events{/number}","events_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/events","assignees_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/assignees{/user}","branches_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/branches{/branch}","tags_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/tags","blobs_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/git/refs{/sha}","trees_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/git/trees{/sha}","statuses_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/statuses/{sha}","languages_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/languages","stargazers_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/stargazers","contributors_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/contributors","subscribers_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/subscribers","subscription_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/subscription","commits_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/commits{/sha}","git_commits_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/git/commits{/sha}","comments_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/comments{/number}","issue_comment_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/issues/comments{/number}","contents_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/contents/{+path}","compare_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/compare/{base}...{head}","merges_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/merges","archive_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/downloads","issues_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/issues{/number}","pulls_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/pulls{/number}","milestones_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/milestones{/number}","notifications_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/labels{/name}","releases_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/releases{/id}","deployments_url":"https://api.github.com/repos/resin-os/resin-yocto-scripts/deployments","created_at":"2016-01-28T18:10:46Z","updated_at":"2016-01-28T19:48:32Z","pushed_at":"2016-05-31T11:24:46Z","git_url":"git://github.com/resin-os/resin-yocto-scripts.git","ssh_url":"git@github.com:resin-os/resin-yocto-scripts.git","clone_url":"https://github.com/resin-os/resin-yocto-scripts.git","svn_url":"https://github.com/resin-os/resin-yocto-scripts","homepage":"https://resin.io","size":124,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/resin-os/resin-yocto-scripts/pulls/17"},"html":{"href":"https://github.com/resin-os/resin-yocto-scripts/pull/17"},"issue":{"href":"https://api.github.com/repos/resin-os/resin-yocto-scripts/issues/17"},"comments":{"href":"https://api.github.com/repos/resin-os/resin-yocto-scripts/issues/17/comments"},"review_comments":{"href":"https://api.github.com/repos/resin-os/resin-yocto-scripts/pulls/17/comments"},"review_comment":{"href":"https://api.github.com/repos/resin-os/resin-yocto-scripts/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/resin-os/resin-yocto-scripts/pulls/17/commits"},"statuses":{"href":"https://api.github.com/repos/resin-os/resin-yocto-scripts/statuses/f7d1b4e0e6dd7986d76a213602f5583dc157c048"}}}}
{"actor":{"display_login":"floion"}}