{"action":"created","comment":{"url":"https://api.github.com/repos/dokku/dokku/pulls/comments/49506263","id":49506263,"diff_hunk":"@@ -0,0 +1,84 @@\n+#!/usr/bin/env bash\n+[[ \" docker-options docker-options:add docker-options:remove help docker-options:help \" == *\" $1 \"* ]] || exit $DOKKU_NOT_IMPLEMENTED_EXIT\n+set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x\n+source \"$PLUGIN_CORE_AVAILABLE_PATH/common/functions\"\n+\n+get_phases() {\n+  local passed_phases_list=\"$1\"\n+  local phases_allowed=$(sed -e 's/ /\\|/g' <<< \"${AVAILABLE_PHASES[@]}\")\n+  local phase\n+  local passed_phases\n+  if [[ -n \"$passed_phases_list\" ]]; then\n+    IFS=',' read -ra passed_phases <<< \"$passed_phases_list\"\n+    for phase in \"${passed_phases[@]}\"; do\n+      [[ \"$phase\" = @($phases_allowed) ]] || dokku_log_fail \"Phase(s) must be one of [${AVAILABLE_PHASES[*]}]\"\n+    done\n+    echo \"${passed_phases[@]}\"\n+  fi\n+}\n+\n+create_phase_file_if_required() {\n+  local phase_file_path=\"$1\"\n+  [[ -f \"$phase_file_path\" ]] || {\n+    touch \"$phase_file_path\"\n+  }\n+}\n+\n+display_phase_options() {\n+  local phase=\"$1\"\n+  local phase_file_path=\"$2\"\n+  echo \"${phase^} options:\"\n+  sed -e 's/^/    /' \"$phase_file_path\"\n+}\n+\n+display_all_phases_options() {","path":"plugins/docker-options/functions","position":34,"original_position":34,"commit_id":"9c0fd34441536c371806b3e5a4a6976194d852ad","original_commit_id":"9c0fd34441536c371806b3e5a4a6976194d852ad","user":{"login":"josegonzalez","id":65675,"avatar_url":"https://avatars.githubusercontent.com/u/65675?v=3","gravatar_id":"","url":"https://api.github.com/users/josegonzalez","html_url":"https://github.com/josegonzalez","followers_url":"https://api.github.com/users/josegonzalez/followers","following_url":"https://api.github.com/users/josegonzalez/following{/other_user}","gists_url":"https://api.github.com/users/josegonzalez/gists{/gist_id}","starred_url":"https://api.github.com/users/josegonzalez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josegonzalez/subscriptions","organizations_url":"https://api.github.com/users/josegonzalez/orgs","repos_url":"https://api.github.com/users/josegonzalez/repos","events_url":"https://api.github.com/users/josegonzalez/events{/privacy}","received_events_url":"https://api.github.com/users/josegonzalez/received_events","type":"User","site_admin":false},"body":"Fair enough, but in this case `$APP` might not be set before the functions are sourced in, right?","created_at":"2016-01-12T20:08:04Z","updated_at":"2016-01-12T20:08:04Z","html_url":"https://github.com/dokku/dokku/pull/1848#discussion_r49506263","pull_request_url":"https://api.github.com/repos/dokku/dokku/pulls/1848","_links":{"self":{"href":"https://api.github.com/repos/dokku/dokku/pulls/comments/49506263"},"html":{"href":"https://github.com/dokku/dokku/pull/1848#discussion_r49506263"},"pull_request":{"href":"https://api.github.com/repos/dokku/dokku/pulls/1848"}}},"pull_request":{"url":"https://api.github.com/repos/dokku/dokku/pulls/1848","id":55526277,"html_url":"https://github.com/dokku/dokku/pull/1848","diff_url":"https://github.com/dokku/dokku/pull/1848.diff","patch_url":"https://github.com/dokku/dokku/pull/1848.patch","issue_url":"https://api.github.com/repos/dokku/dokku/issues/1848","number":1848,"state":"open","locked":false,"title":"Move docker-options functions to functions file, rework phase_file_path","user":{"login":"u2mejc","id":11339468,"avatar_url":"https://avatars.githubusercontent.com/u/11339468?v=3","gravatar_id":"","url":"https://api.github.com/users/u2mejc","html_url":"https://github.com/u2mejc","followers_url":"https://api.github.com/users/u2mejc/followers","following_url":"https://api.github.com/users/u2mejc/following{/other_user}","gists_url":"https://api.github.com/users/u2mejc/gists{/gist_id}","starred_url":"https://api.github.com/users/u2mejc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/u2mejc/subscriptions","organizations_url":"https://api.github.com/users/u2mejc/orgs","repos_url":"https://api.github.com/users/u2mejc/repos","events_url":"https://api.github.com/users/u2mejc/events{/privacy}","received_events_url":"https://api.github.com/users/u2mejc/received_events","type":"User","site_admin":false},"body":"@josegonzalez clean up per request in PR https://github.com/dokku/dokku/pull/1830\r\n\r\nI pulled the docker-options functions out here too, so it won't be part of the first storage plugin commit when I rebase.","created_at":"2016-01-09T00:00:18Z","updated_at":"2016-01-12T20:08:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0344e7f987e646bb9a19e7c87f71a3ea8dcb23d7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dokku/dokku/pulls/1848/commits","review_comments_url":"https://api.github.com/repos/dokku/dokku/pulls/1848/comments","review_comment_url":"https://api.github.com/repos/dokku/dokku/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dokku/dokku/issues/1848/comments","statuses_url":"https://api.github.com/repos/dokku/dokku/statuses/9c0fd34441536c371806b3e5a4a6976194d852ad","head":{"label":"u2mejc:u2mejc_docker-options_functions","ref":"u2mejc_docker-options_functions","sha":"9c0fd34441536c371806b3e5a4a6976194d852ad","user":{"login":"u2mejc","id":11339468,"avatar_url":"https://avatars.githubusercontent.com/u/11339468?v=3","gravatar_id":"","url":"https://api.github.com/users/u2mejc","html_url":"https://github.com/u2mejc","followers_url":"https://api.github.com/users/u2mejc/followers","following_url":"https://api.github.com/users/u2mejc/following{/other_user}","gists_url":"https://api.github.com/users/u2mejc/gists{/gist_id}","starred_url":"https://api.github.com/users/u2mejc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/u2mejc/subscriptions","organizations_url":"https://api.github.com/users/u2mejc/orgs","repos_url":"https://api.github.com/users/u2mejc/repos","events_url":"https://api.github.com/users/u2mejc/events{/privacy}","received_events_url":"https://api.github.com/users/u2mejc/received_events","type":"User","site_admin":false},"repo":{"id":40995878,"name":"dokku","full_name":"u2mejc/dokku","owner":{"login":"u2mejc","id":11339468,"avatar_url":"https://avatars.githubusercontent.com/u/11339468?v=3","gravatar_id":"","url":"https://api.github.com/users/u2mejc","html_url":"https://github.com/u2mejc","followers_url":"https://api.github.com/users/u2mejc/followers","following_url":"https://api.github.com/users/u2mejc/following{/other_user}","gists_url":"https://api.github.com/users/u2mejc/gists{/gist_id}","starred_url":"https://api.github.com/users/u2mejc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/u2mejc/subscriptions","organizations_url":"https://api.github.com/users/u2mejc/orgs","repos_url":"https://api.github.com/users/u2mejc/repos","events_url":"https://api.github.com/users/u2mejc/events{/privacy}","received_events_url":"https://api.github.com/users/u2mejc/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/u2mejc/dokku","description":"Docker powered mini-Heroku in around 100 lines of Bash","fork":true,"url":"https://api.github.com/repos/u2mejc/dokku","forks_url":"https://api.github.com/repos/u2mejc/dokku/forks","keys_url":"https://api.github.com/repos/u2mejc/dokku/keys{/key_id}","collaborators_url":"https://api.github.com/repos/u2mejc/dokku/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/u2mejc/dokku/teams","hooks_url":"https://api.github.com/repos/u2mejc/dokku/hooks","issue_events_url":"https://api.github.com/repos/u2mejc/dokku/issues/events{/number}","events_url":"https://api.github.com/repos/u2mejc/dokku/events","assignees_url":"https://api.github.com/repos/u2mejc/dokku/assignees{/user}","branches_url":"https://api.github.com/repos/u2mejc/dokku/branches{/branch}","tags_url":"https://api.github.com/repos/u2mejc/dokku/tags","blobs_url":"https://api.github.com/repos/u2mejc/dokku/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/u2mejc/dokku/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/u2mejc/dokku/git/refs{/sha}","trees_url":"https://api.github.com/repos/u2mejc/dokku/git/trees{/sha}","statuses_url":"https://api.github.com/repos/u2mejc/dokku/statuses/{sha}","languages_url":"https://api.github.com/repos/u2mejc/dokku/languages","stargazers_url":"https://api.github.com/repos/u2mejc/dokku/stargazers","contributors_url":"https://api.github.com/repos/u2mejc/dokku/contributors","subscribers_url":"https://api.github.com/repos/u2mejc/dokku/subscribers","subscription_url":"https://api.github.com/repos/u2mejc/dokku/subscription","commits_url":"https://api.github.com/repos/u2mejc/dokku/commits{/sha}","git_commits_url":"https://api.github.com/repos/u2mejc/dokku/git/commits{/sha}","comments_url":"https://api.github.com/repos/u2mejc/dokku/comments{/number}","issue_comment_url":"https://api.github.com/repos/u2mejc/dokku/issues/comments{/number}","contents_url":"https://api.github.com/repos/u2mejc/dokku/contents/{+path}","compare_url":"https://api.github.com/repos/u2mejc/dokku/compare/{base}...{head}","merges_url":"https://api.github.com/repos/u2mejc/dokku/merges","archive_url":"https://api.github.com/repos/u2mejc/dokku/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/u2mejc/dokku/downloads","issues_url":"https://api.github.com/repos/u2mejc/dokku/issues{/number}","pulls_url":"https://api.github.com/repos/u2mejc/dokku/pulls{/number}","milestones_url":"https://api.github.com/repos/u2mejc/dokku/milestones{/number}","notifications_url":"https://api.github.com/repos/u2mejc/dokku/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/u2mejc/dokku/labels{/name}","releases_url":"https://api.github.com/repos/u2mejc/dokku/releases{/id}","created_at":"2015-08-18T20:27:33Z","updated_at":"2015-08-18T20:27:33Z","pushed_at":"2016-01-12T02:07:15Z","git_url":"git://github.com/u2mejc/dokku.git","ssh_url":"git@github.com:u2mejc/dokku.git","clone_url":"https://github.com/u2mejc/dokku.git","svn_url":"https://github.com/u2mejc/dokku","homepage":"http://progrium.viewdocs.io/dokku","size":2271,"stargazers_count":0,"watchers_count":0,"language":"Shell","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":"dokku:master","ref":"master","sha":"6931c3df5a4e90afef2b8ab36ad166f854ff9c0b","user":{"login":"dokku","id":13455795,"avatar_url":"https://avatars.githubusercontent.com/u/13455795?v=3","gravatar_id":"","url":"https://api.github.com/users/dokku","html_url":"https://github.com/dokku","followers_url":"https://api.github.com/users/dokku/followers","following_url":"https://api.github.com/users/dokku/following{/other_user}","gists_url":"https://api.github.com/users/dokku/gists{/gist_id}","starred_url":"https://api.github.com/users/dokku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dokku/subscriptions","organizations_url":"https://api.github.com/users/dokku/orgs","repos_url":"https://api.github.com/users/dokku/repos","events_url":"https://api.github.com/users/dokku/events{/privacy}","received_events_url":"https://api.github.com/users/dokku/received_events","type":"Organization","site_admin":false},"repo":{"id":10567197,"name":"dokku","full_name":"dokku/dokku","owner":{"login":"dokku","id":13455795,"avatar_url":"https://avatars.githubusercontent.com/u/13455795?v=3","gravatar_id":"","url":"https://api.github.com/users/dokku","html_url":"https://github.com/dokku","followers_url":"https://api.github.com/users/dokku/followers","following_url":"https://api.github.com/users/dokku/following{/other_user}","gists_url":"https://api.github.com/users/dokku/gists{/gist_id}","starred_url":"https://api.github.com/users/dokku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dokku/subscriptions","organizations_url":"https://api.github.com/users/dokku/orgs","repos_url":"https://api.github.com/users/dokku/repos","events_url":"https://api.github.com/users/dokku/events{/privacy}","received_events_url":"https://api.github.com/users/dokku/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dokku/dokku","description":"A docker-powered PaaS that helps you build and manage the lifecycle of applications","fork":false,"url":"https://api.github.com/repos/dokku/dokku","forks_url":"https://api.github.com/repos/dokku/dokku/forks","keys_url":"https://api.github.com/repos/dokku/dokku/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dokku/dokku/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dokku/dokku/teams","hooks_url":"https://api.github.com/repos/dokku/dokku/hooks","issue_events_url":"https://api.github.com/repos/dokku/dokku/issues/events{/number}","events_url":"https://api.github.com/repos/dokku/dokku/events","assignees_url":"https://api.github.com/repos/dokku/dokku/assignees{/user}","branches_url":"https://api.github.com/repos/dokku/dokku/branches{/branch}","tags_url":"https://api.github.com/repos/dokku/dokku/tags","blobs_url":"https://api.github.com/repos/dokku/dokku/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dokku/dokku/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dokku/dokku/git/refs{/sha}","trees_url":"https://api.github.com/repos/dokku/dokku/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dokku/dokku/statuses/{sha}","languages_url":"https://api.github.com/repos/dokku/dokku/languages","stargazers_url":"https://api.github.com/repos/dokku/dokku/stargazers","contributors_url":"https://api.github.com/repos/dokku/dokku/contributors","subscribers_url":"https://api.github.com/repos/dokku/dokku/subscribers","subscription_url":"https://api.github.com/repos/dokku/dokku/subscription","commits_url":"https://api.github.com/repos/dokku/dokku/commits{/sha}","git_commits_url":"https://api.github.com/repos/dokku/dokku/git/commits{/sha}","comments_url":"https://api.github.com/repos/dokku/dokku/comments{/number}","issue_comment_url":"https://api.github.com/repos/dokku/dokku/issues/comments{/number}","contents_url":"https://api.github.com/repos/dokku/dokku/contents/{+path}","compare_url":"https://api.github.com/repos/dokku/dokku/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dokku/dokku/merges","archive_url":"https://api.github.com/repos/dokku/dokku/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dokku/dokku/downloads","issues_url":"https://api.github.com/repos/dokku/dokku/issues{/number}","pulls_url":"https://api.github.com/repos/dokku/dokku/pulls{/number}","milestones_url":"https://api.github.com/repos/dokku/dokku/milestones{/number}","notifications_url":"https://api.github.com/repos/dokku/dokku/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dokku/dokku/labels{/name}","releases_url":"https://api.github.com/repos/dokku/dokku/releases{/id}","created_at":"2013-06-08T10:26:57Z","updated_at":"2016-01-12T19:31:39Z","pushed_at":"2016-01-12T16:11:20Z","git_url":"git://github.com/dokku/dokku.git","ssh_url":"git@github.com:dokku/dokku.git","clone_url":"https://github.com/dokku/dokku.git","svn_url":"https://github.com/dokku/dokku","homepage":"http://dokku.viewdocs.io/dokku/","size":2916,"stargazers_count":10756,"watchers_count":10756,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":932,"mirror_url":null,"open_issues_count":28,"forks":932,"open_issues":28,"watchers":10756,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dokku/dokku/pulls/1848"},"html":{"href":"https://github.com/dokku/dokku/pull/1848"},"issue":{"href":"https://api.github.com/repos/dokku/dokku/issues/1848"},"comments":{"href":"https://api.github.com/repos/dokku/dokku/issues/1848/comments"},"review_comments":{"href":"https://api.github.com/repos/dokku/dokku/pulls/1848/comments"},"review_comment":{"href":"https://api.github.com/repos/dokku/dokku/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dokku/dokku/pulls/1848/commits"},"statuses":{"href":"https://api.github.com/repos/dokku/dokku/statuses/9c0fd34441536c371806b3e5a4a6976194d852ad"}}}}