{"action":"created","comment":{"url":"https://api.github.com/repos/cdancy/gradle-docker-plugin/pulls/comments/62339306","id":62339306,"diff_hunk":"@@ -15,19 +15,37 @@\n  */\n package com.bmuschko.gradle.docker.tasks.container\n \n+import org.gradle.api.tasks.Input\n+import org.gradle.api.tasks.Optional\n+\n+import java.util.concurrent.TimeUnit\n+\n class DockerWaitContainer extends DockerExistingContainer {\n \n     protected int exitCode\n \n-    DockerWaitContainer(){\n-        ext.getExitCode = {exitCode}\n+    /**\n+     * Wait timeout in seconds.\n+     */\n+    @Input\n+    @Optional\n+    Long timeout\n+\n+    DockerWaitContainer() {\n+        ext.getExitCode = { exitCode }\n     }\n \n     @Override\n     void runRemoteCommand(dockerClient) {\n-        logger.quiet \"Waiting for container with ID '${getContainerId()}'.\"\n+        logger.quiet \"Waiting for container with ID '${getContainerId()}' for ${timeout}s.\"\n         def containerCommand = dockerClient.waitContainerCmd(getContainerId())\n-        exitCode = containerCommand.exec()\n+        def callback = threadContextClassLoader.createWaitContainerResultCallback()\n+        callback = containerCommand.exec(callback)\n+        if (timeout) {\n+            exitCode = callback.awaitStatusCode(timeout, TimeUnit.SECONDS)\n+        } else {","path":"src/main/groovy/com/bmuschko/gradle/docker/tasks/container/DockerWaitContainer.groovy","position":36,"original_position":36,"commit_id":"175185408c25324a0eba61651fe2d5f3b1cd9295","original_commit_id":"175185408c25324a0eba61651fe2d5f3b1cd9295","user":{"login":"cdancy","id":7871459,"avatar_url":"https://avatars.githubusercontent.com/u/7871459?v=3","gravatar_id":"","url":"https://api.github.com/users/cdancy","html_url":"https://github.com/cdancy","followers_url":"https://api.github.com/users/cdancy/followers","following_url":"https://api.github.com/users/cdancy/following{/other_user}","gists_url":"https://api.github.com/users/cdancy/gists{/gist_id}","starred_url":"https://api.github.com/users/cdancy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdancy/subscriptions","organizations_url":"https://api.github.com/users/cdancy/orgs","repos_url":"https://api.github.com/users/cdancy/repos","events_url":"https://api.github.com/users/cdancy/events{/privacy}","received_events_url":"https://api.github.com/users/cdancy/received_events","type":"User","site_admin":false},"body":"Can we do this inline with a ternary operator? Shouldn't look _too_ bad...","created_at":"2016-05-06T14:47:02Z","updated_at":"2016-05-06T14:47:02Z","html_url":"https://github.com/cdancy/gradle-docker-plugin/pull/1#discussion_r62339306","pull_request_url":"https://api.github.com/repos/cdancy/gradle-docker-plugin/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/cdancy/gradle-docker-plugin/pulls/comments/62339306"},"html":{"href":"https://github.com/cdancy/gradle-docker-plugin/pull/1#discussion_r62339306"},"pull_request":{"href":"https://api.github.com/repos/cdancy/gradle-docker-plugin/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/cdancy/gradle-docker-plugin/pulls/1","id":69143870,"html_url":"https://github.com/cdancy/gradle-docker-plugin/pull/1","diff_url":"https://github.com/cdancy/gradle-docker-plugin/pull/1.diff","patch_url":"https://github.com/cdancy/gradle-docker-plugin/pull/1.patch","issue_url":"https://api.github.com/repos/cdancy/gradle-docker-plugin/issues/1","number":1,"state":"open","locked":false,"title":"docker-java 3.0.0 API implementation","user":{"login":"orzeh","id":8168237,"avatar_url":"https://avatars.githubusercontent.com/u/8168237?v=3","gravatar_id":"","url":"https://api.github.com/users/orzeh","html_url":"https://github.com/orzeh","followers_url":"https://api.github.com/users/orzeh/followers","following_url":"https://api.github.com/users/orzeh/following{/other_user}","gists_url":"https://api.github.com/users/orzeh/gists{/gist_id}","starred_url":"https://api.github.com/users/orzeh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orzeh/subscriptions","organizations_url":"https://api.github.com/users/orzeh/orgs","repos_url":"https://api.github.com/users/orzeh/repos","events_url":"https://api.github.com/users/orzeh/events{/privacy}","received_events_url":"https://api.github.com/users/orzeh/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-05-06T12:27:55Z","updated_at":"2016-05-06T14:47:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f40a7dc3e061dc6fc745718a6535a032b0daa9c4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cdancy/gradle-docker-plugin/pulls/1/commits","review_comments_url":"https://api.github.com/repos/cdancy/gradle-docker-plugin/pulls/1/comments","review_comment_url":"https://api.github.com/repos/cdancy/gradle-docker-plugin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cdancy/gradle-docker-plugin/issues/1/comments","statuses_url":"https://api.github.com/repos/cdancy/gradle-docker-plugin/statuses/175185408c25324a0eba61651fe2d5f3b1cd9295","head":{"label":"orzeh:docker-java-3.0.0","ref":"docker-java-3.0.0","sha":"175185408c25324a0eba61651fe2d5f3b1cd9295","user":{"login":"orzeh","id":8168237,"avatar_url":"https://avatars.githubusercontent.com/u/8168237?v=3","gravatar_id":"","url":"https://api.github.com/users/orzeh","html_url":"https://github.com/orzeh","followers_url":"https://api.github.com/users/orzeh/followers","following_url":"https://api.github.com/users/orzeh/following{/other_user}","gists_url":"https://api.github.com/users/orzeh/gists{/gist_id}","starred_url":"https://api.github.com/users/orzeh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orzeh/subscriptions","organizations_url":"https://api.github.com/users/orzeh/orgs","repos_url":"https://api.github.com/users/orzeh/repos","events_url":"https://api.github.com/users/orzeh/events{/privacy}","received_events_url":"https://api.github.com/users/orzeh/received_events","type":"User","site_admin":false},"repo":{"id":58205180,"name":"gradle-docker-plugin","full_name":"orzeh/gradle-docker-plugin","owner":{"login":"orzeh","id":8168237,"avatar_url":"https://avatars.githubusercontent.com/u/8168237?v=3","gravatar_id":"","url":"https://api.github.com/users/orzeh","html_url":"https://github.com/orzeh","followers_url":"https://api.github.com/users/orzeh/followers","following_url":"https://api.github.com/users/orzeh/following{/other_user}","gists_url":"https://api.github.com/users/orzeh/gists{/gist_id}","starred_url":"https://api.github.com/users/orzeh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orzeh/subscriptions","organizations_url":"https://api.github.com/users/orzeh/orgs","repos_url":"https://api.github.com/users/orzeh/repos","events_url":"https://api.github.com/users/orzeh/events{/privacy}","received_events_url":"https://api.github.com/users/orzeh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/orzeh/gradle-docker-plugin","description":"Gradle plugin for managing Docker images and containers.","fork":true,"url":"https://api.github.com/repos/orzeh/gradle-docker-plugin","forks_url":"https://api.github.com/repos/orzeh/gradle-docker-plugin/forks","keys_url":"https://api.github.com/repos/orzeh/gradle-docker-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/orzeh/gradle-docker-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/orzeh/gradle-docker-plugin/teams","hooks_url":"https://api.github.com/repos/orzeh/gradle-docker-plugin/hooks","issue_events_url":"https://api.github.com/repos/orzeh/gradle-docker-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/orzeh/gradle-docker-plugin/events","assignees_url":"https://api.github.com/repos/orzeh/gradle-docker-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/orzeh/gradle-docker-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/orzeh/gradle-docker-plugin/tags","blobs_url":"https://api.github.com/repos/orzeh/gradle-docker-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/orzeh/gradle-docker-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/orzeh/gradle-docker-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/orzeh/gradle-docker-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/orzeh/gradle-docker-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/orzeh/gradle-docker-plugin/languages","stargazers_url":"https://api.github.com/repos/orzeh/gradle-docker-plugin/stargazers","contributors_url":"https://api.github.com/repos/orzeh/gradle-docker-plugin/contributors","subscribers_url":"https://api.github.com/repos/orzeh/gradle-docker-plugin/subscribers","subscription_url":"https://api.github.com/repos/orzeh/gradle-docker-plugin/subscription","commits_url":"https://api.github.com/repos/orzeh/gradle-docker-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/orzeh/gradle-docker-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/orzeh/gradle-docker-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/orzeh/gradle-docker-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/orzeh/gradle-docker-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/orzeh/gradle-docker-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/orzeh/gradle-docker-plugin/merges","archive_url":"https://api.github.com/repos/orzeh/gradle-docker-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/orzeh/gradle-docker-plugin/downloads","issues_url":"https://api.github.com/repos/orzeh/gradle-docker-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/orzeh/gradle-docker-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/orzeh/gradle-docker-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/orzeh/gradle-docker-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/orzeh/gradle-docker-plugin/labels{/name}","releases_url":"https://api.github.com/repos/orzeh/gradle-docker-plugin/releases{/id}","deployments_url":"https://api.github.com/repos/orzeh/gradle-docker-plugin/deployments","created_at":"2016-05-06T12:17:56Z","updated_at":"2016-05-06T12:17:57Z","pushed_at":"2016-05-06T12:26:11Z","git_url":"git://github.com/orzeh/gradle-docker-plugin.git","ssh_url":"git@github.com:orzeh/gradle-docker-plugin.git","clone_url":"https://github.com/orzeh/gradle-docker-plugin.git","svn_url":"https://github.com/orzeh/gradle-docker-plugin","homepage":"","size":1256,"stargazers_count":0,"watchers_count":0,"language":"Groovy","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cdancy:docker-java-3","ref":"docker-java-3","sha":"23e2610329c6050130661a854c36b82b7fc48961","user":{"login":"cdancy","id":7871459,"avatar_url":"https://avatars.githubusercontent.com/u/7871459?v=3","gravatar_id":"","url":"https://api.github.com/users/cdancy","html_url":"https://github.com/cdancy","followers_url":"https://api.github.com/users/cdancy/followers","following_url":"https://api.github.com/users/cdancy/following{/other_user}","gists_url":"https://api.github.com/users/cdancy/gists{/gist_id}","starred_url":"https://api.github.com/users/cdancy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdancy/subscriptions","organizations_url":"https://api.github.com/users/cdancy/orgs","repos_url":"https://api.github.com/users/cdancy/repos","events_url":"https://api.github.com/users/cdancy/events{/privacy}","received_events_url":"https://api.github.com/users/cdancy/received_events","type":"User","site_admin":false},"repo":{"id":42660165,"name":"gradle-docker-plugin","full_name":"cdancy/gradle-docker-plugin","owner":{"login":"cdancy","id":7871459,"avatar_url":"https://avatars.githubusercontent.com/u/7871459?v=3","gravatar_id":"","url":"https://api.github.com/users/cdancy","html_url":"https://github.com/cdancy","followers_url":"https://api.github.com/users/cdancy/followers","following_url":"https://api.github.com/users/cdancy/following{/other_user}","gists_url":"https://api.github.com/users/cdancy/gists{/gist_id}","starred_url":"https://api.github.com/users/cdancy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdancy/subscriptions","organizations_url":"https://api.github.com/users/cdancy/orgs","repos_url":"https://api.github.com/users/cdancy/repos","events_url":"https://api.github.com/users/cdancy/events{/privacy}","received_events_url":"https://api.github.com/users/cdancy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cdancy/gradle-docker-plugin","description":"Gradle plugin for managing Docker images and containers.","fork":true,"url":"https://api.github.com/repos/cdancy/gradle-docker-plugin","forks_url":"https://api.github.com/repos/cdancy/gradle-docker-plugin/forks","keys_url":"https://api.github.com/repos/cdancy/gradle-docker-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cdancy/gradle-docker-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cdancy/gradle-docker-plugin/teams","hooks_url":"https://api.github.com/repos/cdancy/gradle-docker-plugin/hooks","issue_events_url":"https://api.github.com/repos/cdancy/gradle-docker-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/cdancy/gradle-docker-plugin/events","assignees_url":"https://api.github.com/repos/cdancy/gradle-docker-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/cdancy/gradle-docker-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/cdancy/gradle-docker-plugin/tags","blobs_url":"https://api.github.com/repos/cdancy/gradle-docker-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cdancy/gradle-docker-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cdancy/gradle-docker-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/cdancy/gradle-docker-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cdancy/gradle-docker-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/cdancy/gradle-docker-plugin/languages","stargazers_url":"https://api.github.com/repos/cdancy/gradle-docker-plugin/stargazers","contributors_url":"https://api.github.com/repos/cdancy/gradle-docker-plugin/contributors","subscribers_url":"https://api.github.com/repos/cdancy/gradle-docker-plugin/subscribers","subscription_url":"https://api.github.com/repos/cdancy/gradle-docker-plugin/subscription","commits_url":"https://api.github.com/repos/cdancy/gradle-docker-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/cdancy/gradle-docker-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/cdancy/gradle-docker-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/cdancy/gradle-docker-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/cdancy/gradle-docker-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/cdancy/gradle-docker-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cdancy/gradle-docker-plugin/merges","archive_url":"https://api.github.com/repos/cdancy/gradle-docker-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cdancy/gradle-docker-plugin/downloads","issues_url":"https://api.github.com/repos/cdancy/gradle-docker-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/cdancy/gradle-docker-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/cdancy/gradle-docker-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/cdancy/gradle-docker-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cdancy/gradle-docker-plugin/labels{/name}","releases_url":"https://api.github.com/repos/cdancy/gradle-docker-plugin/releases{/id}","deployments_url":"https://api.github.com/repos/cdancy/gradle-docker-plugin/deployments","created_at":"2015-09-17T14:15:16Z","updated_at":"2016-02-05T02:35:55Z","pushed_at":"2016-05-06T14:15:41Z","git_url":"git://github.com/cdancy/gradle-docker-plugin.git","ssh_url":"git@github.com:cdancy/gradle-docker-plugin.git","clone_url":"https://github.com/cdancy/gradle-docker-plugin.git","svn_url":"https://github.com/cdancy/gradle-docker-plugin","homepage":"","size":1256,"stargazers_count":0,"watchers_count":0,"language":"Groovy","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cdancy/gradle-docker-plugin/pulls/1"},"html":{"href":"https://github.com/cdancy/gradle-docker-plugin/pull/1"},"issue":{"href":"https://api.github.com/repos/cdancy/gradle-docker-plugin/issues/1"},"comments":{"href":"https://api.github.com/repos/cdancy/gradle-docker-plugin/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/cdancy/gradle-docker-plugin/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/cdancy/gradle-docker-plugin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cdancy/gradle-docker-plugin/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/cdancy/gradle-docker-plugin/statuses/175185408c25324a0eba61651fe2d5f3b1cd9295"}}}}