{"action":"created","comment":{"url":"https://api.github.com/repos/openshift/source-to-image/pulls/comments/51449473","id":51449473,"diff_hunk":"@@ -21,14 +21,19 @@ type Environment struct {\n // GetEnvironment gets the .sti/environment file located in the sources and\n // parse it into []environment\n func GetEnvironment(config *api.Config) ([]Environment, error) {\n-\tenvPath := filepath.Join(config.WorkingDir, api.Source, \".sti\", api.Environment)\n+\tenvPath := filepath.Join(config.WorkingDir, api.Source, \".s2i\", api.Environment)\n \tif _, err := os.Stat(envPath); os.IsNotExist(err) {\n-\t\treturn nil, errors.New(\"no environment file found in application sources\")\n+\t\t// TODO: Remove this when the '.sti/environment' is deprecated.\n+\t\tenvPath = filepath.Join(config.WorkingDir, api.Source, \".sti\", api.Environment)\n+\t\tif _, err := os.Stat(envPath); os.IsNotExist(err) {\n+\t\t\treturn nil, errors.New(\"no environment file found in application sources\")\n+\t\t}\n+\t\tglog.Infof(\"DEPRECATED: Use .s2i/environment instead of .sti/environment\")\n \t}\n \n \tf, err := os.Open(envPath)\n \tif err != nil {\n-\t\treturn nil, errors.New(\"unable to read .sti/environment file\")\n+\t\treturn nil, errors.New(\"unable to read custom environment file\")","path":"pkg/scripts/environment.go","position":23,"original_position":19,"commit_id":"4ec62a25c3ad20c061a20ae1bfba6a2c3f0d9b8f","original_commit_id":"7d404905734cd3e79e839697578d9fdf4264e26a","user":{"login":"bparees","id":4974046,"avatar_url":"https://avatars.githubusercontent.com/u/4974046?v=3","gravatar_id":"","url":"https://api.github.com/users/bparees","html_url":"https://github.com/bparees","followers_url":"https://api.github.com/users/bparees/followers","following_url":"https://api.github.com/users/bparees/following{/other_user}","gists_url":"https://api.github.com/users/bparees/gists{/gist_id}","starred_url":"https://api.github.com/users/bparees/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bparees/subscriptions","organizations_url":"https://api.github.com/users/bparees/orgs","repos_url":"https://api.github.com/users/bparees/repos","events_url":"https://api.github.com/users/bparees/events{/privacy}","received_events_url":"https://api.github.com/users/bparees/received_events","type":"User","site_admin":false},"body":"Yeah i'm aware but if there's an error reading it, the full path is useful.\nThis should be very rare anyway.\n\nBen Parees | OpenShift\nOn Feb 1, 2016 11:57 AM, \"Michal Fojtik\" <notifications@github.com> wrote:\n\n> In pkg/scripts/environment.go\n> <https://github.com/openshift/source-to-image/pull/405#discussion_r51445494>\n> :\n>\n> >  \t}\n> >\n> >  \tf, err := os.Open(envPath)\n> >  \tif err != nil {\n> > -\t\treturn nil, errors.New(\"unable to read .sti/environment file\")\n> > +\t\treturn nil, errors.New(\"unable to read custom environment file\")\n>\n> @bparees <https://github.com/bparees> problem with that is that envPath\n> resolves to full path (including the workdir and it looks *really* ugly\n> in console then ;-)\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/openshift/source-to-image/pull/405/files#r51445494>.\n>\n","created_at":"2016-02-01T17:25:26Z","updated_at":"2016-02-01T17:25:26Z","html_url":"https://github.com/openshift/source-to-image/pull/405#discussion_r51449473","pull_request_url":"https://api.github.com/repos/openshift/source-to-image/pulls/405","_links":{"self":{"href":"https://api.github.com/repos/openshift/source-to-image/pulls/comments/51449473"},"html":{"href":"https://github.com/openshift/source-to-image/pull/405#discussion_r51449473"},"pull_request":{"href":"https://api.github.com/repos/openshift/source-to-image/pulls/405"}}},"pull_request":{"url":"https://api.github.com/repos/openshift/source-to-image/pulls/405","id":57831907,"html_url":"https://github.com/openshift/source-to-image/pull/405","diff_url":"https://github.com/openshift/source-to-image/pull/405.diff","patch_url":"https://github.com/openshift/source-to-image/pull/405.patch","issue_url":"https://api.github.com/repos/openshift/source-to-image/issues/405","number":405,"state":"open","locked":false,"title":"Deprecate .sti/environment","user":{"login":"mfojtik","id":44136,"avatar_url":"https://avatars.githubusercontent.com/u/44136?v=3","gravatar_id":"","url":"https://api.github.com/users/mfojtik","html_url":"https://github.com/mfojtik","followers_url":"https://api.github.com/users/mfojtik/followers","following_url":"https://api.github.com/users/mfojtik/following{/other_user}","gists_url":"https://api.github.com/users/mfojtik/gists{/gist_id}","starred_url":"https://api.github.com/users/mfojtik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfojtik/subscriptions","organizations_url":"https://api.github.com/users/mfojtik/orgs","repos_url":"https://api.github.com/users/mfojtik/repos","events_url":"https://api.github.com/users/mfojtik/events{/privacy}","received_events_url":"https://api.github.com/users/mfojtik/received_events","type":"User","site_admin":false},"body":"@bparees FYI\r\n\r\nThis is a leftover from deprecating the `.sti` in `api.ScriptSource`. Also I'm adding glog.Infof() here because I think seeing that the environment of the build is going to change based on provided file is important to user to confirm the file is actually picked up and the env vars are used.","created_at":"2016-02-01T12:16:45Z","updated_at":"2016-02-01T17:25:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c86de347f1b744539f120ca0b6ef8f52cf2096cb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openshift/source-to-image/pulls/405/commits","review_comments_url":"https://api.github.com/repos/openshift/source-to-image/pulls/405/comments","review_comment_url":"https://api.github.com/repos/openshift/source-to-image/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openshift/source-to-image/issues/405/comments","statuses_url":"https://api.github.com/repos/openshift/source-to-image/statuses/4ec62a25c3ad20c061a20ae1bfba6a2c3f0d9b8f","head":{"label":"mfojtik:deprecated-env-path","ref":"deprecated-env-path","sha":"4ec62a25c3ad20c061a20ae1bfba6a2c3f0d9b8f","user":{"login":"mfojtik","id":44136,"avatar_url":"https://avatars.githubusercontent.com/u/44136?v=3","gravatar_id":"","url":"https://api.github.com/users/mfojtik","html_url":"https://github.com/mfojtik","followers_url":"https://api.github.com/users/mfojtik/followers","following_url":"https://api.github.com/users/mfojtik/following{/other_user}","gists_url":"https://api.github.com/users/mfojtik/gists{/gist_id}","starred_url":"https://api.github.com/users/mfojtik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfojtik/subscriptions","organizations_url":"https://api.github.com/users/mfojtik/orgs","repos_url":"https://api.github.com/users/mfojtik/repos","events_url":"https://api.github.com/users/mfojtik/events{/privacy}","received_events_url":"https://api.github.com/users/mfojtik/received_events","type":"User","site_admin":false},"repo":{"id":26119317,"name":"source-to-image","full_name":"mfojtik/source-to-image","owner":{"login":"mfojtik","id":44136,"avatar_url":"https://avatars.githubusercontent.com/u/44136?v=3","gravatar_id":"","url":"https://api.github.com/users/mfojtik","html_url":"https://github.com/mfojtik","followers_url":"https://api.github.com/users/mfojtik/followers","following_url":"https://api.github.com/users/mfojtik/following{/other_user}","gists_url":"https://api.github.com/users/mfojtik/gists{/gist_id}","starred_url":"https://api.github.com/users/mfojtik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfojtik/subscriptions","organizations_url":"https://api.github.com/users/mfojtik/orgs","repos_url":"https://api.github.com/users/mfojtik/repos","events_url":"https://api.github.com/users/mfojtik/events{/privacy}","received_events_url":"https://api.github.com/users/mfojtik/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mfojtik/source-to-image","description":"A tool for building/building artifacts from source and injecting into docker images","fork":true,"url":"https://api.github.com/repos/mfojtik/source-to-image","forks_url":"https://api.github.com/repos/mfojtik/source-to-image/forks","keys_url":"https://api.github.com/repos/mfojtik/source-to-image/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mfojtik/source-to-image/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mfojtik/source-to-image/teams","hooks_url":"https://api.github.com/repos/mfojtik/source-to-image/hooks","issue_events_url":"https://api.github.com/repos/mfojtik/source-to-image/issues/events{/number}","events_url":"https://api.github.com/repos/mfojtik/source-to-image/events","assignees_url":"https://api.github.com/repos/mfojtik/source-to-image/assignees{/user}","branches_url":"https://api.github.com/repos/mfojtik/source-to-image/branches{/branch}","tags_url":"https://api.github.com/repos/mfojtik/source-to-image/tags","blobs_url":"https://api.github.com/repos/mfojtik/source-to-image/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mfojtik/source-to-image/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mfojtik/source-to-image/git/refs{/sha}","trees_url":"https://api.github.com/repos/mfojtik/source-to-image/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mfojtik/source-to-image/statuses/{sha}","languages_url":"https://api.github.com/repos/mfojtik/source-to-image/languages","stargazers_url":"https://api.github.com/repos/mfojtik/source-to-image/stargazers","contributors_url":"https://api.github.com/repos/mfojtik/source-to-image/contributors","subscribers_url":"https://api.github.com/repos/mfojtik/source-to-image/subscribers","subscription_url":"https://api.github.com/repos/mfojtik/source-to-image/subscription","commits_url":"https://api.github.com/repos/mfojtik/source-to-image/commits{/sha}","git_commits_url":"https://api.github.com/repos/mfojtik/source-to-image/git/commits{/sha}","comments_url":"https://api.github.com/repos/mfojtik/source-to-image/comments{/number}","issue_comment_url":"https://api.github.com/repos/mfojtik/source-to-image/issues/comments{/number}","contents_url":"https://api.github.com/repos/mfojtik/source-to-image/contents/{+path}","compare_url":"https://api.github.com/repos/mfojtik/source-to-image/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mfojtik/source-to-image/merges","archive_url":"https://api.github.com/repos/mfojtik/source-to-image/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mfojtik/source-to-image/downloads","issues_url":"https://api.github.com/repos/mfojtik/source-to-image/issues{/number}","pulls_url":"https://api.github.com/repos/mfojtik/source-to-image/pulls{/number}","milestones_url":"https://api.github.com/repos/mfojtik/source-to-image/milestones{/number}","notifications_url":"https://api.github.com/repos/mfojtik/source-to-image/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mfojtik/source-to-image/labels{/name}","releases_url":"https://api.github.com/repos/mfojtik/source-to-image/releases{/id}","deployments_url":"https://api.github.com/repos/mfojtik/source-to-image/deployments","created_at":"2014-11-03T13:18:28Z","updated_at":"2016-01-12T09:37:57Z","pushed_at":"2016-02-01T16:59:39Z","git_url":"git://github.com/mfojtik/source-to-image.git","ssh_url":"git@github.com:mfojtik/source-to-image.git","clone_url":"https://github.com/mfojtik/source-to-image.git","svn_url":"https://github.com/mfojtik/source-to-image","homepage":"","size":2634,"stargazers_count":0,"watchers_count":0,"language":"Go","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":"openshift:master","ref":"master","sha":"f30208380974bdf302263c8a21b3e8a04f0bb909","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":16323162,"name":"source-to-image","full_name":"openshift/source-to-image","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/source-to-image","description":"A tool for building/building artifacts from source and injecting into docker images","fork":false,"url":"https://api.github.com/repos/openshift/source-to-image","forks_url":"https://api.github.com/repos/openshift/source-to-image/forks","keys_url":"https://api.github.com/repos/openshift/source-to-image/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openshift/source-to-image/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openshift/source-to-image/teams","hooks_url":"https://api.github.com/repos/openshift/source-to-image/hooks","issue_events_url":"https://api.github.com/repos/openshift/source-to-image/issues/events{/number}","events_url":"https://api.github.com/repos/openshift/source-to-image/events","assignees_url":"https://api.github.com/repos/openshift/source-to-image/assignees{/user}","branches_url":"https://api.github.com/repos/openshift/source-to-image/branches{/branch}","tags_url":"https://api.github.com/repos/openshift/source-to-image/tags","blobs_url":"https://api.github.com/repos/openshift/source-to-image/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openshift/source-to-image/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openshift/source-to-image/git/refs{/sha}","trees_url":"https://api.github.com/repos/openshift/source-to-image/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openshift/source-to-image/statuses/{sha}","languages_url":"https://api.github.com/repos/openshift/source-to-image/languages","stargazers_url":"https://api.github.com/repos/openshift/source-to-image/stargazers","contributors_url":"https://api.github.com/repos/openshift/source-to-image/contributors","subscribers_url":"https://api.github.com/repos/openshift/source-to-image/subscribers","subscription_url":"https://api.github.com/repos/openshift/source-to-image/subscription","commits_url":"https://api.github.com/repos/openshift/source-to-image/commits{/sha}","git_commits_url":"https://api.github.com/repos/openshift/source-to-image/git/commits{/sha}","comments_url":"https://api.github.com/repos/openshift/source-to-image/comments{/number}","issue_comment_url":"https://api.github.com/repos/openshift/source-to-image/issues/comments{/number}","contents_url":"https://api.github.com/repos/openshift/source-to-image/contents/{+path}","compare_url":"https://api.github.com/repos/openshift/source-to-image/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openshift/source-to-image/merges","archive_url":"https://api.github.com/repos/openshift/source-to-image/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openshift/source-to-image/downloads","issues_url":"https://api.github.com/repos/openshift/source-to-image/issues{/number}","pulls_url":"https://api.github.com/repos/openshift/source-to-image/pulls{/number}","milestones_url":"https://api.github.com/repos/openshift/source-to-image/milestones{/number}","notifications_url":"https://api.github.com/repos/openshift/source-to-image/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openshift/source-to-image/labels{/name}","releases_url":"https://api.github.com/repos/openshift/source-to-image/releases{/id}","deployments_url":"https://api.github.com/repos/openshift/source-to-image/deployments","created_at":"2014-01-28T19:32:40Z","updated_at":"2016-01-29T16:56:13Z","pushed_at":"2016-02-01T16:59:39Z","git_url":"git://github.com/openshift/source-to-image.git","ssh_url":"git@github.com:openshift/source-to-image.git","clone_url":"https://github.com/openshift/source-to-image.git","svn_url":"https://github.com/openshift/source-to-image","homepage":"","size":2224,"stargazers_count":167,"watchers_count":167,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":86,"mirror_url":null,"open_issues_count":18,"forks":86,"open_issues":18,"watchers":167,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openshift/source-to-image/pulls/405"},"html":{"href":"https://github.com/openshift/source-to-image/pull/405"},"issue":{"href":"https://api.github.com/repos/openshift/source-to-image/issues/405"},"comments":{"href":"https://api.github.com/repos/openshift/source-to-image/issues/405/comments"},"review_comments":{"href":"https://api.github.com/repos/openshift/source-to-image/pulls/405/comments"},"review_comment":{"href":"https://api.github.com/repos/openshift/source-to-image/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openshift/source-to-image/pulls/405/commits"},"statuses":{"href":"https://api.github.com/repos/openshift/source-to-image/statuses/4ec62a25c3ad20c061a20ae1bfba6a2c3f0d9b8f"}}}}