{"action":"created","comment":{"url":"https://api.github.com/repos/openshift/origin/pulls/comments/51432269","id":51432269,"diff_hunk":"@@ -382,6 +386,21 @@ type SourceBuildStrategy struct {\n \tForcePull bool `json:\"forcePull,omitempty\" description:\"forces the source build to pull the image if true\"`\n }\n \n+// BuildPostCommitSpec holds a build post commit hook specification.\n+type BuildPostCommitSpec struct {\n+\t// Shell is an action that executes a shell script in a container\n+\t// running the build output image.\n+\tShell string `json:\"shell,omitempty\" description:\"shell script to be executed in a container running the build output image\"`","path":"pkg/build/api/v1beta3/types.go","position":19,"original_position":19,"commit_id":"6342b920e4bf8cbca4d47e69b9578f7c3c355e75","original_commit_id":"6342b920e4bf8cbca4d47e69b9578f7c3c355e75","user":{"login":"smarterclayton","id":1163175,"avatar_url":"https://avatars.githubusercontent.com/u/1163175?v=3","gravatar_id":"","url":"https://api.github.com/users/smarterclayton","html_url":"https://github.com/smarterclayton","followers_url":"https://api.github.com/users/smarterclayton/followers","following_url":"https://api.github.com/users/smarterclayton/following{/other_user}","gists_url":"https://api.github.com/users/smarterclayton/gists{/gist_id}","starred_url":"https://api.github.com/users/smarterclayton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarterclayton/subscriptions","organizations_url":"https://api.github.com/users/smarterclayton/orgs","repos_url":"https://api.github.com/users/smarterclayton/repos","events_url":"https://api.github.com/users/smarterclayton/events{/privacy}","received_events_url":"https://api.github.com/users/smarterclayton/received_events","type":"User","site_admin":false},"body":"I think I'd accept this pattern if it was:\r\n\r\n```\r\nShellArgs []string\r\nArgs []string\r\nCommand []string\r\n```\r\n\r\nSpecifying ShellArgs and either Args or Command is a validation error.  Specifying Args and Command together is valid.  ShellArgs must be an array - otherwise there is no way for callers to guarantee that that proper quoting is preserved across all runtimes.  The implementation of ShellArgs should follow the same patterns as described before.  Taking just a string loses context for the program and makes escaping harder for end users (bash escaping is hard to get right, we should help users do it).\r\n\r\nI would approve an API change with those tweaks.  \r\n","created_at":"2016-02-01T15:35:24Z","updated_at":"2016-02-01T15:35:24Z","html_url":"https://github.com/openshift/origin/pull/6715#discussion_r51432269","pull_request_url":"https://api.github.com/repos/openshift/origin/pulls/6715","_links":{"self":{"href":"https://api.github.com/repos/openshift/origin/pulls/comments/51432269"},"html":{"href":"https://github.com/openshift/origin/pull/6715#discussion_r51432269"},"pull_request":{"href":"https://api.github.com/repos/openshift/origin/pulls/6715"}}},"pull_request":{"url":"https://api.github.com/repos/openshift/origin/pulls/6715","id":56471452,"html_url":"https://github.com/openshift/origin/pull/6715","diff_url":"https://github.com/openshift/origin/pull/6715.diff","patch_url":"https://github.com/openshift/origin/pull/6715.patch","issue_url":"https://api.github.com/repos/openshift/origin/issues/6715","number":6715,"state":"open","locked":false,"title":"[WIP] Run user-provided command as part of build flow","user":{"login":"rhcarvalho","id":88819,"avatar_url":"https://avatars.githubusercontent.com/u/88819?v=3","gravatar_id":"","url":"https://api.github.com/users/rhcarvalho","html_url":"https://github.com/rhcarvalho","followers_url":"https://api.github.com/users/rhcarvalho/followers","following_url":"https://api.github.com/users/rhcarvalho/following{/other_user}","gists_url":"https://api.github.com/users/rhcarvalho/gists{/gist_id}","starred_url":"https://api.github.com/users/rhcarvalho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhcarvalho/subscriptions","organizations_url":"https://api.github.com/users/rhcarvalho/orgs","repos_url":"https://api.github.com/users/rhcarvalho/repos","events_url":"https://api.github.com/users/rhcarvalho/events{/privacy}","received_events_url":"https://api.github.com/users/rhcarvalho/received_events","type":"User","site_admin":false},"body":"This is meant to be used for running project unit tests as part of a build.\r\n\r\nTrello card: https://trello.com/c/I1v1YeOf\r\nCloses #6758\r\n\r\nThis PR/card won't introduce changes to `oc new-build` nor `oc new-app` nor the Web Console.\r\nFor now, the feature can be used via `oc edit bc`.\r\n\r\n-----------------------\r\nPending work:\r\n- [ ] agreement on API changes\r\n- [x] tests\r\n- [x] clean up\r\n- [ ] maybe move some code to source-to-image\r\n- [ ] if build fails because of failure in the post commit hook, there should be a clear error message to reflect that (see [pkg/build/builder/common.go#L56](https://github.com/openshift/origin/blob/1f99c77a509d2bf179e948c17c68332462811e35/pkg/build/builder/common.go#L56) and [pkg/build/registry/build/strategy.go#L103](https://github.com/openshift/origin/blob/1f99c77a509d2bf179e948c17c68332462811e35/pkg/build/registry/build/strategy.go#L103))","created_at":"2016-01-19T14:18:59Z","updated_at":"2016-02-01T15:35:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"77fdc8855488ae9cd94dac469c4c2268f9669628","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openshift/origin/pulls/6715/commits","review_comments_url":"https://api.github.com/repos/openshift/origin/pulls/6715/comments","review_comment_url":"https://api.github.com/repos/openshift/origin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openshift/origin/issues/6715/comments","statuses_url":"https://api.github.com/repos/openshift/origin/statuses/6342b920e4bf8cbca4d47e69b9578f7c3c355e75","head":{"label":"rhcarvalho:build-post-commit-pre-push-usr-cmd","ref":"build-post-commit-pre-push-usr-cmd","sha":"6342b920e4bf8cbca4d47e69b9578f7c3c355e75","user":{"login":"rhcarvalho","id":88819,"avatar_url":"https://avatars.githubusercontent.com/u/88819?v=3","gravatar_id":"","url":"https://api.github.com/users/rhcarvalho","html_url":"https://github.com/rhcarvalho","followers_url":"https://api.github.com/users/rhcarvalho/followers","following_url":"https://api.github.com/users/rhcarvalho/following{/other_user}","gists_url":"https://api.github.com/users/rhcarvalho/gists{/gist_id}","starred_url":"https://api.github.com/users/rhcarvalho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhcarvalho/subscriptions","organizations_url":"https://api.github.com/users/rhcarvalho/orgs","repos_url":"https://api.github.com/users/rhcarvalho/repos","events_url":"https://api.github.com/users/rhcarvalho/events{/privacy}","received_events_url":"https://api.github.com/users/rhcarvalho/received_events","type":"User","site_admin":false},"repo":{"id":30794668,"name":"origin","full_name":"rhcarvalho/origin","owner":{"login":"rhcarvalho","id":88819,"avatar_url":"https://avatars.githubusercontent.com/u/88819?v=3","gravatar_id":"","url":"https://api.github.com/users/rhcarvalho","html_url":"https://github.com/rhcarvalho","followers_url":"https://api.github.com/users/rhcarvalho/followers","following_url":"https://api.github.com/users/rhcarvalho/following{/other_user}","gists_url":"https://api.github.com/users/rhcarvalho/gists{/gist_id}","starred_url":"https://api.github.com/users/rhcarvalho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhcarvalho/subscriptions","organizations_url":"https://api.github.com/users/rhcarvalho/orgs","repos_url":"https://api.github.com/users/rhcarvalho/repos","events_url":"https://api.github.com/users/rhcarvalho/events{/privacy}","received_events_url":"https://api.github.com/users/rhcarvalho/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rhcarvalho/origin","description":"OpenShift 3 - build, deploy, and manage your applications with Docker and Kubernetes","fork":true,"url":"https://api.github.com/repos/rhcarvalho/origin","forks_url":"https://api.github.com/repos/rhcarvalho/origin/forks","keys_url":"https://api.github.com/repos/rhcarvalho/origin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rhcarvalho/origin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rhcarvalho/origin/teams","hooks_url":"https://api.github.com/repos/rhcarvalho/origin/hooks","issue_events_url":"https://api.github.com/repos/rhcarvalho/origin/issues/events{/number}","events_url":"https://api.github.com/repos/rhcarvalho/origin/events","assignees_url":"https://api.github.com/repos/rhcarvalho/origin/assignees{/user}","branches_url":"https://api.github.com/repos/rhcarvalho/origin/branches{/branch}","tags_url":"https://api.github.com/repos/rhcarvalho/origin/tags","blobs_url":"https://api.github.com/repos/rhcarvalho/origin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rhcarvalho/origin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rhcarvalho/origin/git/refs{/sha}","trees_url":"https://api.github.com/repos/rhcarvalho/origin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rhcarvalho/origin/statuses/{sha}","languages_url":"https://api.github.com/repos/rhcarvalho/origin/languages","stargazers_url":"https://api.github.com/repos/rhcarvalho/origin/stargazers","contributors_url":"https://api.github.com/repos/rhcarvalho/origin/contributors","subscribers_url":"https://api.github.com/repos/rhcarvalho/origin/subscribers","subscription_url":"https://api.github.com/repos/rhcarvalho/origin/subscription","commits_url":"https://api.github.com/repos/rhcarvalho/origin/commits{/sha}","git_commits_url":"https://api.github.com/repos/rhcarvalho/origin/git/commits{/sha}","comments_url":"https://api.github.com/repos/rhcarvalho/origin/comments{/number}","issue_comment_url":"https://api.github.com/repos/rhcarvalho/origin/issues/comments{/number}","contents_url":"https://api.github.com/repos/rhcarvalho/origin/contents/{+path}","compare_url":"https://api.github.com/repos/rhcarvalho/origin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rhcarvalho/origin/merges","archive_url":"https://api.github.com/repos/rhcarvalho/origin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rhcarvalho/origin/downloads","issues_url":"https://api.github.com/repos/rhcarvalho/origin/issues{/number}","pulls_url":"https://api.github.com/repos/rhcarvalho/origin/pulls{/number}","milestones_url":"https://api.github.com/repos/rhcarvalho/origin/milestones{/number}","notifications_url":"https://api.github.com/repos/rhcarvalho/origin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rhcarvalho/origin/labels{/name}","releases_url":"https://api.github.com/repos/rhcarvalho/origin/releases{/id}","deployments_url":"https://api.github.com/repos/rhcarvalho/origin/deployments","created_at":"2015-02-14T11:22:53Z","updated_at":"2016-01-13T10:20:06Z","pushed_at":"2016-02-01T15:29:38Z","git_url":"git://github.com/rhcarvalho/origin.git","ssh_url":"git@github.com:rhcarvalho/origin.git","clone_url":"https://github.com/rhcarvalho/origin.git","svn_url":"https://github.com/rhcarvalho/origin","homepage":"https://openshift.github.io","size":199714,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"openshift:master","ref":"master","sha":"1b24a8ddb81bcfcfa5c9e3bd4ba8459bbf540521","user":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"repo":{"id":22442668,"name":"origin","full_name":"openshift/origin","owner":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openshift/origin","description":"OpenShift 3 - build, deploy, and manage your applications with Docker and Kubernetes","fork":false,"url":"https://api.github.com/repos/openshift/origin","forks_url":"https://api.github.com/repos/openshift/origin/forks","keys_url":"https://api.github.com/repos/openshift/origin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openshift/origin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openshift/origin/teams","hooks_url":"https://api.github.com/repos/openshift/origin/hooks","issue_events_url":"https://api.github.com/repos/openshift/origin/issues/events{/number}","events_url":"https://api.github.com/repos/openshift/origin/events","assignees_url":"https://api.github.com/repos/openshift/origin/assignees{/user}","branches_url":"https://api.github.com/repos/openshift/origin/branches{/branch}","tags_url":"https://api.github.com/repos/openshift/origin/tags","blobs_url":"https://api.github.com/repos/openshift/origin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openshift/origin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openshift/origin/git/refs{/sha}","trees_url":"https://api.github.com/repos/openshift/origin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openshift/origin/statuses/{sha}","languages_url":"https://api.github.com/repos/openshift/origin/languages","stargazers_url":"https://api.github.com/repos/openshift/origin/stargazers","contributors_url":"https://api.github.com/repos/openshift/origin/contributors","subscribers_url":"https://api.github.com/repos/openshift/origin/subscribers","subscription_url":"https://api.github.com/repos/openshift/origin/subscription","commits_url":"https://api.github.com/repos/openshift/origin/commits{/sha}","git_commits_url":"https://api.github.com/repos/openshift/origin/git/commits{/sha}","comments_url":"https://api.github.com/repos/openshift/origin/comments{/number}","issue_comment_url":"https://api.github.com/repos/openshift/origin/issues/comments{/number}","contents_url":"https://api.github.com/repos/openshift/origin/contents/{+path}","compare_url":"https://api.github.com/repos/openshift/origin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openshift/origin/merges","archive_url":"https://api.github.com/repos/openshift/origin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openshift/origin/downloads","issues_url":"https://api.github.com/repos/openshift/origin/issues{/number}","pulls_url":"https://api.github.com/repos/openshift/origin/pulls{/number}","milestones_url":"https://api.github.com/repos/openshift/origin/milestones{/number}","notifications_url":"https://api.github.com/repos/openshift/origin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openshift/origin/labels{/name}","releases_url":"https://api.github.com/repos/openshift/origin/releases{/id}","deployments_url":"https://api.github.com/repos/openshift/origin/deployments","created_at":"2014-07-30T20:04:05Z","updated_at":"2016-02-01T15:14:05Z","pushed_at":"2016-02-01T15:22:46Z","git_url":"git://github.com/openshift/origin.git","ssh_url":"git@github.com:openshift/origin.git","clone_url":"https://github.com/openshift/origin.git","svn_url":"https://github.com/openshift/origin","homepage":"http://www.openshift.org","size":250457,"stargazers_count":957,"watchers_count":957,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":604,"mirror_url":null,"open_issues_count":783,"forks":604,"open_issues":783,"watchers":957,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openshift/origin/pulls/6715"},"html":{"href":"https://github.com/openshift/origin/pull/6715"},"issue":{"href":"https://api.github.com/repos/openshift/origin/issues/6715"},"comments":{"href":"https://api.github.com/repos/openshift/origin/issues/6715/comments"},"review_comments":{"href":"https://api.github.com/repos/openshift/origin/pulls/6715/comments"},"review_comment":{"href":"https://api.github.com/repos/openshift/origin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openshift/origin/pulls/6715/commits"},"statuses":{"href":"https://api.github.com/repos/openshift/origin/statuses/6342b920e4bf8cbca4d47e69b9578f7c3c355e75"}}}}