{"action":"created","comment":{"url":"https://api.github.com/repos/hdt91/samson/pulls/comments/64253190","id":64253190,"diff_hunk":"@@ -21,9 +22,32 @@ def run!(image_name: nil, push: false)\n       @output = execution.output\n       repository.executor = execution.executor\n \n-      if build_image(tmp_dir)\n-        push_image(image_name) if push\n-        build.docker_image.remove(force: true)\n+      if kuber_job\n+        kuber_job = Kubernetes::JobExecutor.new(output, job: job)\n+        docker_ref = image_name.presence || build.label.try(:parameterize).presence || 'latest'\n+\n+        success, build_log = kuber_job.build!(build.git_sha,\n+                                              repo: project.docker_repo, tag: docker_ref, push: push,\n+                                              registry: registry_credentials)\n+        if push\n+          build.docker_ref = docker_ref\n+          build.docker_repo_digest = nil\n+        end\n+\n+        if success and !build_log.blank?\n+          build_log.each_line do |line|\n+            if (matches = DOCKER_REPO_REGEX.match(line))","path":"app/models/docker_builder_service.rb","position":38,"original_position":38,"commit_id":"53aee443bf30c37244534e99d888793c473445eb","original_commit_id":"53aee443bf30c37244534e99d888793c473445eb","user":{"login":"grosser","id":11367,"avatar_url":"https://avatars.githubusercontent.com/u/11367?v=3","gravatar_id":"","url":"https://api.github.com/users/grosser","html_url":"https://github.com/grosser","followers_url":"https://api.github.com/users/grosser/followers","following_url":"https://api.github.com/users/grosser/following{/other_user}","gists_url":"https://api.github.com/users/grosser/gists{/gist_id}","starred_url":"https://api.github.com/users/grosser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grosser/subscriptions","organizations_url":"https://api.github.com/users/grosser/orgs","repos_url":"https://api.github.com/users/grosser/repos","events_url":"https://api.github.com/users/grosser/events{/privacy}","received_events_url":"https://api.github.com/users/grosser/received_events","type":"User","site_admin":false},"body":"should blow up if it cannot find the ref too ?","created_at":"2016-05-23T17:13:33Z","updated_at":"2016-05-23T17:13:33Z","html_url":"https://github.com/hdt91/samson/pull/1#discussion_r64253190","pull_request_url":"https://api.github.com/repos/hdt91/samson/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/hdt91/samson/pulls/comments/64253190"},"html":{"href":"https://github.com/hdt91/samson/pull/1#discussion_r64253190"},"pull_request":{"href":"https://api.github.com/repos/hdt91/samson/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/hdt91/samson/pulls/1","id":71083199,"html_url":"https://github.com/hdt91/samson/pull/1","diff_url":"https://github.com/hdt91/samson/pull/1.diff","patch_url":"https://github.com/hdt91/samson/pull/1.patch","issue_url":"https://api.github.com/repos/hdt91/samson/issues/1","number":1,"state":"open","locked":false,"title":"Preview commit","user":{"login":"grosser","id":11367,"avatar_url":"https://avatars.githubusercontent.com/u/11367?v=3","gravatar_id":"","url":"https://api.github.com/users/grosser","html_url":"https://github.com/grosser","followers_url":"https://api.github.com/users/grosser/followers","following_url":"https://api.github.com/users/grosser/following{/other_user}","gists_url":"https://api.github.com/users/grosser/gists{/gist_id}","starred_url":"https://api.github.com/users/grosser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grosser/subscriptions","organizations_url":"https://api.github.com/users/grosser/orgs","repos_url":"https://api.github.com/users/grosser/repos","events_url":"https://api.github.com/users/grosser/events{/privacy}","received_events_url":"https://api.github.com/users/grosser/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-05-23T16:55:23Z","updated_at":"2016-05-23T17:13:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/hdt91/samson/pulls/1/commits","review_comments_url":"https://api.github.com/repos/hdt91/samson/pulls/1/comments","review_comment_url":"https://api.github.com/repos/hdt91/samson/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hdt91/samson/issues/1/comments","statuses_url":"https://api.github.com/repos/hdt91/samson/statuses/53aee443bf30c37244534e99d888793c473445eb","head":{"label":"hdt91:dang/build_job","ref":"dang/build_job","sha":"53aee443bf30c37244534e99d888793c473445eb","user":{"login":"hdt91","id":1161962,"avatar_url":"https://avatars.githubusercontent.com/u/1161962?v=3","gravatar_id":"","url":"https://api.github.com/users/hdt91","html_url":"https://github.com/hdt91","followers_url":"https://api.github.com/users/hdt91/followers","following_url":"https://api.github.com/users/hdt91/following{/other_user}","gists_url":"https://api.github.com/users/hdt91/gists{/gist_id}","starred_url":"https://api.github.com/users/hdt91/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hdt91/subscriptions","organizations_url":"https://api.github.com/users/hdt91/orgs","repos_url":"https://api.github.com/users/hdt91/repos","events_url":"https://api.github.com/users/hdt91/events{/privacy}","received_events_url":"https://api.github.com/users/hdt91/received_events","type":"User","site_admin":false},"repo":{"id":58945639,"name":"samson","full_name":"hdt91/samson","owner":{"login":"hdt91","id":1161962,"avatar_url":"https://avatars.githubusercontent.com/u/1161962?v=3","gravatar_id":"","url":"https://api.github.com/users/hdt91","html_url":"https://github.com/hdt91","followers_url":"https://api.github.com/users/hdt91/followers","following_url":"https://api.github.com/users/hdt91/following{/other_user}","gists_url":"https://api.github.com/users/hdt91/gists{/gist_id}","starred_url":"https://api.github.com/users/hdt91/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hdt91/subscriptions","organizations_url":"https://api.github.com/users/hdt91/orgs","repos_url":"https://api.github.com/users/hdt91/repos","events_url":"https://api.github.com/users/hdt91/events{/privacy}","received_events_url":"https://api.github.com/users/hdt91/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hdt91/samson","description":"Web interface for deployments","fork":true,"url":"https://api.github.com/repos/hdt91/samson","forks_url":"https://api.github.com/repos/hdt91/samson/forks","keys_url":"https://api.github.com/repos/hdt91/samson/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hdt91/samson/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hdt91/samson/teams","hooks_url":"https://api.github.com/repos/hdt91/samson/hooks","issue_events_url":"https://api.github.com/repos/hdt91/samson/issues/events{/number}","events_url":"https://api.github.com/repos/hdt91/samson/events","assignees_url":"https://api.github.com/repos/hdt91/samson/assignees{/user}","branches_url":"https://api.github.com/repos/hdt91/samson/branches{/branch}","tags_url":"https://api.github.com/repos/hdt91/samson/tags","blobs_url":"https://api.github.com/repos/hdt91/samson/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hdt91/samson/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hdt91/samson/git/refs{/sha}","trees_url":"https://api.github.com/repos/hdt91/samson/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hdt91/samson/statuses/{sha}","languages_url":"https://api.github.com/repos/hdt91/samson/languages","stargazers_url":"https://api.github.com/repos/hdt91/samson/stargazers","contributors_url":"https://api.github.com/repos/hdt91/samson/contributors","subscribers_url":"https://api.github.com/repos/hdt91/samson/subscribers","subscription_url":"https://api.github.com/repos/hdt91/samson/subscription","commits_url":"https://api.github.com/repos/hdt91/samson/commits{/sha}","git_commits_url":"https://api.github.com/repos/hdt91/samson/git/commits{/sha}","comments_url":"https://api.github.com/repos/hdt91/samson/comments{/number}","issue_comment_url":"https://api.github.com/repos/hdt91/samson/issues/comments{/number}","contents_url":"https://api.github.com/repos/hdt91/samson/contents/{+path}","compare_url":"https://api.github.com/repos/hdt91/samson/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hdt91/samson/merges","archive_url":"https://api.github.com/repos/hdt91/samson/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hdt91/samson/downloads","issues_url":"https://api.github.com/repos/hdt91/samson/issues{/number}","pulls_url":"https://api.github.com/repos/hdt91/samson/pulls{/number}","milestones_url":"https://api.github.com/repos/hdt91/samson/milestones{/number}","notifications_url":"https://api.github.com/repos/hdt91/samson/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hdt91/samson/labels{/name}","releases_url":"https://api.github.com/repos/hdt91/samson/releases{/id}","deployments_url":"https://api.github.com/repos/hdt91/samson/deployments","created_at":"2016-05-16T15:54:21Z","updated_at":"2016-05-16T15:54:23Z","pushed_at":"2016-05-17T15:18:21Z","git_url":"git://github.com/hdt91/samson.git","ssh_url":"git@github.com:hdt91/samson.git","clone_url":"https://github.com/hdt91/samson.git","svn_url":"https://github.com/hdt91/samson","homepage":null,"size":177235,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"hdt91:master","ref":"master","sha":"b37dba2fc5fb0bc0abaa57ded804b44615cb927e","user":{"login":"hdt91","id":1161962,"avatar_url":"https://avatars.githubusercontent.com/u/1161962?v=3","gravatar_id":"","url":"https://api.github.com/users/hdt91","html_url":"https://github.com/hdt91","followers_url":"https://api.github.com/users/hdt91/followers","following_url":"https://api.github.com/users/hdt91/following{/other_user}","gists_url":"https://api.github.com/users/hdt91/gists{/gist_id}","starred_url":"https://api.github.com/users/hdt91/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hdt91/subscriptions","organizations_url":"https://api.github.com/users/hdt91/orgs","repos_url":"https://api.github.com/users/hdt91/repos","events_url":"https://api.github.com/users/hdt91/events{/privacy}","received_events_url":"https://api.github.com/users/hdt91/received_events","type":"User","site_admin":false},"repo":{"id":58945639,"name":"samson","full_name":"hdt91/samson","owner":{"login":"hdt91","id":1161962,"avatar_url":"https://avatars.githubusercontent.com/u/1161962?v=3","gravatar_id":"","url":"https://api.github.com/users/hdt91","html_url":"https://github.com/hdt91","followers_url":"https://api.github.com/users/hdt91/followers","following_url":"https://api.github.com/users/hdt91/following{/other_user}","gists_url":"https://api.github.com/users/hdt91/gists{/gist_id}","starred_url":"https://api.github.com/users/hdt91/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hdt91/subscriptions","organizations_url":"https://api.github.com/users/hdt91/orgs","repos_url":"https://api.github.com/users/hdt91/repos","events_url":"https://api.github.com/users/hdt91/events{/privacy}","received_events_url":"https://api.github.com/users/hdt91/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hdt91/samson","description":"Web interface for deployments","fork":true,"url":"https://api.github.com/repos/hdt91/samson","forks_url":"https://api.github.com/repos/hdt91/samson/forks","keys_url":"https://api.github.com/repos/hdt91/samson/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hdt91/samson/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hdt91/samson/teams","hooks_url":"https://api.github.com/repos/hdt91/samson/hooks","issue_events_url":"https://api.github.com/repos/hdt91/samson/issues/events{/number}","events_url":"https://api.github.com/repos/hdt91/samson/events","assignees_url":"https://api.github.com/repos/hdt91/samson/assignees{/user}","branches_url":"https://api.github.com/repos/hdt91/samson/branches{/branch}","tags_url":"https://api.github.com/repos/hdt91/samson/tags","blobs_url":"https://api.github.com/repos/hdt91/samson/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hdt91/samson/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hdt91/samson/git/refs{/sha}","trees_url":"https://api.github.com/repos/hdt91/samson/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hdt91/samson/statuses/{sha}","languages_url":"https://api.github.com/repos/hdt91/samson/languages","stargazers_url":"https://api.github.com/repos/hdt91/samson/stargazers","contributors_url":"https://api.github.com/repos/hdt91/samson/contributors","subscribers_url":"https://api.github.com/repos/hdt91/samson/subscribers","subscription_url":"https://api.github.com/repos/hdt91/samson/subscription","commits_url":"https://api.github.com/repos/hdt91/samson/commits{/sha}","git_commits_url":"https://api.github.com/repos/hdt91/samson/git/commits{/sha}","comments_url":"https://api.github.com/repos/hdt91/samson/comments{/number}","issue_comment_url":"https://api.github.com/repos/hdt91/samson/issues/comments{/number}","contents_url":"https://api.github.com/repos/hdt91/samson/contents/{+path}","compare_url":"https://api.github.com/repos/hdt91/samson/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hdt91/samson/merges","archive_url":"https://api.github.com/repos/hdt91/samson/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hdt91/samson/downloads","issues_url":"https://api.github.com/repos/hdt91/samson/issues{/number}","pulls_url":"https://api.github.com/repos/hdt91/samson/pulls{/number}","milestones_url":"https://api.github.com/repos/hdt91/samson/milestones{/number}","notifications_url":"https://api.github.com/repos/hdt91/samson/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hdt91/samson/labels{/name}","releases_url":"https://api.github.com/repos/hdt91/samson/releases{/id}","deployments_url":"https://api.github.com/repos/hdt91/samson/deployments","created_at":"2016-05-16T15:54:21Z","updated_at":"2016-05-16T15:54:23Z","pushed_at":"2016-05-17T15:18:21Z","git_url":"git://github.com/hdt91/samson.git","ssh_url":"git@github.com:hdt91/samson.git","clone_url":"https://github.com/hdt91/samson.git","svn_url":"https://github.com/hdt91/samson","homepage":null,"size":177235,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hdt91/samson/pulls/1"},"html":{"href":"https://github.com/hdt91/samson/pull/1"},"issue":{"href":"https://api.github.com/repos/hdt91/samson/issues/1"},"comments":{"href":"https://api.github.com/repos/hdt91/samson/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/hdt91/samson/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/hdt91/samson/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hdt91/samson/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/hdt91/samson/statuses/53aee443bf30c37244534e99d888793c473445eb"}}}}
{"actor":{"display_login":"grosser"}}