{"action":"created","comment":{"url":"https://api.github.com/repos/openshift/openshift-docs/pulls/comments/52283830","id":52283830,"diff_hunk":"@@ -1184,6 +1190,80 @@ spec:\n ----\n ====\n \n+[[build-hooks]]\n+\n+== Build Hooks\n+Build hooks can be used as a part of the build flow to run tests inside a temporary container and validate your image before it is being pushed to the registry. The command is executed with the current working directory set to the image's `WORKDIR`.\n+The hook will fail if the script or command returns a non-zero exit code or if there's any other error related to starting the temporary container. When the hook fails it will mark the build as failed.\n+====\n+----\n+spec:\n+  postCommit: <1>\n+    command:\n+      -\"sh\"\n+      -\"-c\"\n+    args: \"rake test\" <2>\n+    script: \"rake test\" <3>\n+----\n+<1> `command` is the command to run. This might be needed if the image doesn't have \"/bin/sh\" or if you do not want to use a shell. In all other cases, using `script` might be more convenient.\n+\n+<2> `args` is a list of arguments that are provided to either `command`,\n+`script` or the default entrypoint of the image. The arguments are\n+placed immediately after the command to be run.\n+\n+<3> `script` is a shell script to be run with `/bin/sh -c`. Use `script` when a shell script is appropriate to execute the post build hook, for example for running unit tests with \"rake test\". If you need control over the image entrypoint, or if the image does not have \"/bin/sh\", use `command` and/or `args`.\n+\n+*NOTE: It is invalid to provide both `Script` and `Command` simultaneously. If none of the fields are specified, the hook is not executed.","path":"dev_guide/builds.adoc","position":47,"original_position":47,"commit_id":"65cbaa1219e149a0778d053b5db7242d491f9a5b","original_commit_id":"65cbaa1219e149a0778d053b5db7242d491f9a5b","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":"There is some special syntax for note blocks. For a one-liner note, the case here, it is:\r\n\r\n```asciidoc\r\nNOTE: this is a note.\r\n```\r\n\r\nNote that there should be no \"*\" in the beginning of the line.\r\nAnd if the note is lengthier, there's this format as well:\r\n\r\n```asciidoc\r\n[NOTE]\r\n====\r\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus.\r\nSed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec\r\nconsectetur ante hendrerit. Donec et mollis dolor. Praesent et diam eget libero\r\negestas mattis sit amet vitae augue.\r\n====\r\n```","created_at":"2016-02-09T09:29:14Z","updated_at":"2016-02-09T09:29:14Z","html_url":"https://github.com/openshift/openshift-docs/pull/1448#discussion_r52283830","pull_request_url":"https://api.github.com/repos/openshift/openshift-docs/pulls/1448","_links":{"self":{"href":"https://api.github.com/repos/openshift/openshift-docs/pulls/comments/52283830"},"html":{"href":"https://github.com/openshift/openshift-docs/pull/1448#discussion_r52283830"},"pull_request":{"href":"https://api.github.com/repos/openshift/openshift-docs/pulls/1448"}}},"pull_request":{"url":"https://api.github.com/repos/openshift/openshift-docs/pulls/1448","id":56457051,"html_url":"https://github.com/openshift/openshift-docs/pull/1448","diff_url":"https://github.com/openshift/openshift-docs/pull/1448.diff","patch_url":"https://github.com/openshift/openshift-docs/pull/1448.patch","issue_url":"https://api.github.com/repos/openshift/openshift-docs/issues/1448","number":1448,"state":"open","locked":false,"title":"[WIP] Run post commit and pre-push command","user":{"login":"PI-Victor","id":6294120,"avatar_url":"https://avatars.githubusercontent.com/u/6294120?v=3","gravatar_id":"","url":"https://api.github.com/users/PI-Victor","html_url":"https://github.com/PI-Victor","followers_url":"https://api.github.com/users/PI-Victor/followers","following_url":"https://api.github.com/users/PI-Victor/following{/other_user}","gists_url":"https://api.github.com/users/PI-Victor/gists{/gist_id}","starred_url":"https://api.github.com/users/PI-Victor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PI-Victor/subscriptions","organizations_url":"https://api.github.com/users/PI-Victor/orgs","repos_url":"https://api.github.com/users/PI-Victor/repos","events_url":"https://api.github.com/users/PI-Victor/events{/privacy}","received_events_url":"https://api.github.com/users/PI-Victor/received_events","type":"User","site_admin":false},"body":"trello card ref: https://trello.com/c/I1v1YeOf/844-8-implement-post-build-command\r\nSigned-off-by: pi-victor <ipalade@redhat.com>\n\n<!-- Reviewable:start -->\n[<img src=\"https://reviewable.io/review_button.png\" height=40 alt=\"Review on Reviewable\"/>](https://reviewable.io/reviews/openshift/openshift-docs/1448)\n<!-- Reviewable:end -->\n","created_at":"2016-01-19T12:04:55Z","updated_at":"2016-02-09T09:29:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"50025584bada95183a587716000000b5c10473c1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openshift/openshift-docs/pulls/1448/commits","review_comments_url":"https://api.github.com/repos/openshift/openshift-docs/pulls/1448/comments","review_comment_url":"https://api.github.com/repos/openshift/openshift-docs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openshift/openshift-docs/issues/1448/comments","statuses_url":"https://api.github.com/repos/openshift/openshift-docs/statuses/65cbaa1219e149a0778d053b5db7242d491f9a5b","head":{"label":"PI-Victor:pi-victor/post_build_actions","ref":"pi-victor/post_build_actions","sha":"65cbaa1219e149a0778d053b5db7242d491f9a5b","user":{"login":"PI-Victor","id":6294120,"avatar_url":"https://avatars.githubusercontent.com/u/6294120?v=3","gravatar_id":"","url":"https://api.github.com/users/PI-Victor","html_url":"https://github.com/PI-Victor","followers_url":"https://api.github.com/users/PI-Victor/followers","following_url":"https://api.github.com/users/PI-Victor/following{/other_user}","gists_url":"https://api.github.com/users/PI-Victor/gists{/gist_id}","starred_url":"https://api.github.com/users/PI-Victor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PI-Victor/subscriptions","organizations_url":"https://api.github.com/users/PI-Victor/orgs","repos_url":"https://api.github.com/users/PI-Victor/repos","events_url":"https://api.github.com/users/PI-Victor/events{/privacy}","received_events_url":"https://api.github.com/users/PI-Victor/received_events","type":"User","site_admin":false},"repo":{"id":44237138,"name":"openshift-docs","full_name":"PI-Victor/openshift-docs","owner":{"login":"PI-Victor","id":6294120,"avatar_url":"https://avatars.githubusercontent.com/u/6294120?v=3","gravatar_id":"","url":"https://api.github.com/users/PI-Victor","html_url":"https://github.com/PI-Victor","followers_url":"https://api.github.com/users/PI-Victor/followers","following_url":"https://api.github.com/users/PI-Victor/following{/other_user}","gists_url":"https://api.github.com/users/PI-Victor/gists{/gist_id}","starred_url":"https://api.github.com/users/PI-Victor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PI-Victor/subscriptions","organizations_url":"https://api.github.com/users/PI-Victor/orgs","repos_url":"https://api.github.com/users/PI-Victor/repos","events_url":"https://api.github.com/users/PI-Victor/events{/privacy}","received_events_url":"https://api.github.com/users/PI-Victor/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/PI-Victor/openshift-docs","description":"OpenShift Documentation","fork":true,"url":"https://api.github.com/repos/PI-Victor/openshift-docs","forks_url":"https://api.github.com/repos/PI-Victor/openshift-docs/forks","keys_url":"https://api.github.com/repos/PI-Victor/openshift-docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PI-Victor/openshift-docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PI-Victor/openshift-docs/teams","hooks_url":"https://api.github.com/repos/PI-Victor/openshift-docs/hooks","issue_events_url":"https://api.github.com/repos/PI-Victor/openshift-docs/issues/events{/number}","events_url":"https://api.github.com/repos/PI-Victor/openshift-docs/events","assignees_url":"https://api.github.com/repos/PI-Victor/openshift-docs/assignees{/user}","branches_url":"https://api.github.com/repos/PI-Victor/openshift-docs/branches{/branch}","tags_url":"https://api.github.com/repos/PI-Victor/openshift-docs/tags","blobs_url":"https://api.github.com/repos/PI-Victor/openshift-docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PI-Victor/openshift-docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PI-Victor/openshift-docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/PI-Victor/openshift-docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PI-Victor/openshift-docs/statuses/{sha}","languages_url":"https://api.github.com/repos/PI-Victor/openshift-docs/languages","stargazers_url":"https://api.github.com/repos/PI-Victor/openshift-docs/stargazers","contributors_url":"https://api.github.com/repos/PI-Victor/openshift-docs/contributors","subscribers_url":"https://api.github.com/repos/PI-Victor/openshift-docs/subscribers","subscription_url":"https://api.github.com/repos/PI-Victor/openshift-docs/subscription","commits_url":"https://api.github.com/repos/PI-Victor/openshift-docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/PI-Victor/openshift-docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/PI-Victor/openshift-docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/PI-Victor/openshift-docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/PI-Victor/openshift-docs/contents/{+path}","compare_url":"https://api.github.com/repos/PI-Victor/openshift-docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PI-Victor/openshift-docs/merges","archive_url":"https://api.github.com/repos/PI-Victor/openshift-docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PI-Victor/openshift-docs/downloads","issues_url":"https://api.github.com/repos/PI-Victor/openshift-docs/issues{/number}","pulls_url":"https://api.github.com/repos/PI-Victor/openshift-docs/pulls{/number}","milestones_url":"https://api.github.com/repos/PI-Victor/openshift-docs/milestones{/number}","notifications_url":"https://api.github.com/repos/PI-Victor/openshift-docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PI-Victor/openshift-docs/labels{/name}","releases_url":"https://api.github.com/repos/PI-Victor/openshift-docs/releases{/id}","deployments_url":"https://api.github.com/repos/PI-Victor/openshift-docs/deployments","created_at":"2015-10-14T09:18:57Z","updated_at":"2016-02-08T19:12:46Z","pushed_at":"2016-02-08T19:47:16Z","git_url":"git://github.com/PI-Victor/openshift-docs.git","ssh_url":"git@github.com:PI-Victor/openshift-docs.git","clone_url":"https://github.com/PI-Victor/openshift-docs.git","svn_url":"https://github.com/PI-Victor/openshift-docs","homepage":null,"size":7116,"stargazers_count":0,"watchers_count":0,"language":"CSS","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":"cb414eadfe37bb8648b962a77702f6a30c22691d","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":21740844,"name":"openshift-docs","full_name":"openshift/openshift-docs","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/openshift-docs","description":"OpenShift Documentation","fork":false,"url":"https://api.github.com/repos/openshift/openshift-docs","forks_url":"https://api.github.com/repos/openshift/openshift-docs/forks","keys_url":"https://api.github.com/repos/openshift/openshift-docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openshift/openshift-docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openshift/openshift-docs/teams","hooks_url":"https://api.github.com/repos/openshift/openshift-docs/hooks","issue_events_url":"https://api.github.com/repos/openshift/openshift-docs/issues/events{/number}","events_url":"https://api.github.com/repos/openshift/openshift-docs/events","assignees_url":"https://api.github.com/repos/openshift/openshift-docs/assignees{/user}","branches_url":"https://api.github.com/repos/openshift/openshift-docs/branches{/branch}","tags_url":"https://api.github.com/repos/openshift/openshift-docs/tags","blobs_url":"https://api.github.com/repos/openshift/openshift-docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openshift/openshift-docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openshift/openshift-docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/openshift/openshift-docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openshift/openshift-docs/statuses/{sha}","languages_url":"https://api.github.com/repos/openshift/openshift-docs/languages","stargazers_url":"https://api.github.com/repos/openshift/openshift-docs/stargazers","contributors_url":"https://api.github.com/repos/openshift/openshift-docs/contributors","subscribers_url":"https://api.github.com/repos/openshift/openshift-docs/subscribers","subscription_url":"https://api.github.com/repos/openshift/openshift-docs/subscription","commits_url":"https://api.github.com/repos/openshift/openshift-docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/openshift/openshift-docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/openshift/openshift-docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/openshift/openshift-docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/openshift/openshift-docs/contents/{+path}","compare_url":"https://api.github.com/repos/openshift/openshift-docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openshift/openshift-docs/merges","archive_url":"https://api.github.com/repos/openshift/openshift-docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openshift/openshift-docs/downloads","issues_url":"https://api.github.com/repos/openshift/openshift-docs/issues{/number}","pulls_url":"https://api.github.com/repos/openshift/openshift-docs/pulls{/number}","milestones_url":"https://api.github.com/repos/openshift/openshift-docs/milestones{/number}","notifications_url":"https://api.github.com/repos/openshift/openshift-docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openshift/openshift-docs/labels{/name}","releases_url":"https://api.github.com/repos/openshift/openshift-docs/releases{/id}","deployments_url":"https://api.github.com/repos/openshift/openshift-docs/deployments","created_at":"2014-07-11T15:14:42Z","updated_at":"2016-01-31T22:33:01Z","pushed_at":"2016-02-09T05:49:29Z","git_url":"git://github.com/openshift/openshift-docs.git","ssh_url":"git@github.com:openshift/openshift-docs.git","clone_url":"https://github.com/openshift/openshift-docs.git","svn_url":"https://github.com/openshift/openshift-docs","homepage":"https://docs.openshift.org/latest/welcome/index.html","size":10444,"stargazers_count":41,"watchers_count":41,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":177,"mirror_url":null,"open_issues_count":118,"forks":177,"open_issues":118,"watchers":41,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openshift/openshift-docs/pulls/1448"},"html":{"href":"https://github.com/openshift/openshift-docs/pull/1448"},"issue":{"href":"https://api.github.com/repos/openshift/openshift-docs/issues/1448"},"comments":{"href":"https://api.github.com/repos/openshift/openshift-docs/issues/1448/comments"},"review_comments":{"href":"https://api.github.com/repos/openshift/openshift-docs/pulls/1448/comments"},"review_comment":{"href":"https://api.github.com/repos/openshift/openshift-docs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openshift/openshift-docs/pulls/1448/commits"},"statuses":{"href":"https://api.github.com/repos/openshift/openshift-docs/statuses/65cbaa1219e149a0778d053b5db7242d491f9a5b"}}}}