{"action":"created","comment":{"url":"https://api.github.com/repos/openshift/sti-python/pulls/comments/31951886","id":31951886,"diff_hunk":"@@ -1,23 +1,66 @@\n #!/bin/bash\n \n-# For SCL enablement\n-source .bashrc\n+# This script uses these environment variables:\n+#\n+# DISABLE_COLLECTSTATIC: if not empty, inhibits execution of 'manage.py collectstatic'.\n \n-set -e\n+function assemble() {\n+  # For SCL enablement\n+  source .bashrc\n \n-echo \"---> Copying application source ...\"\n-cp -Rf /tmp/src/. ./\n+  set -e\n \n-if [ -f setup.py ]; then\n-    echo \"---> Installing application ...\"\n-    python setup.py install --user\n-elif [ -f requirements.txt ]; then\n-    echo \"---> Installing dependencies ...\"\n-    pip install --user -r requirements.txt\n-fi\n+  echo \"---> Copying application source ...\"\n+  cp -Rf /tmp/src/. ./\n \n-# set permissions for any installed artifacts\n-chmod -R og+rwx /opt/openshift\n+  if [ -f requirements.txt ]; then\n+      echo \"---> Installing dependencies ...\"\n+      pip install --user -r requirements.txt\n+  fi\n \n-# remove pip temporary directory\n-rm -rf /tmp/pip_build_default\n+  if [ -f setup.py ]; then\n+      echo \"---> Installing application ...\"\n+      python setup.py install --user\n+  fi\n+\n+  # set permissions for any installed artifacts\n+  chmod -R og+rwx /opt/openshift\n+\n+  set +e\n+  django_collectstatic\n+  set -e\n+\n+  # remove pip temporary directory\n+  rm -rf /tmp/pip_build_default\n+}\n+\n+function django_collectstatic() {\n+  [ -n \"$DISABLE_COLLECTSTATIC\" ] && return\n+  ! pip show -q django && return\n+\n+  # Find shallowest manage.py script, either ./manage.py or <project>/manage.py\n+  local manage_py=$(find . -maxdepth 2 -type f -name 'manage.py' -printf '%d\\t%P\\n' | sort -nk1 | cut -f2 | head -1)","path":"3.3/.sti/bin/assemble","position":58,"original_position":58,"commit_id":"f505e6434264b1c4c48189afc161c9796b237959","original_commit_id":"be81b04fd3e2bddea6eede3ab495855d3972079d","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":"I read it as \"manage py\", because that's always the name of it...\r\n\r\n-- \"python manage py do something\"","created_at":"2015-06-08T19:48:38Z","updated_at":"2015-06-08T19:48:38Z","html_url":"https://github.com/openshift/sti-python/pull/12#discussion_r31951886","pull_request_url":"https://api.github.com/repos/openshift/sti-python/pulls/12","_links":{"self":{"href":"https://api.github.com/repos/openshift/sti-python/pulls/comments/31951886"},"html":{"href":"https://github.com/openshift/sti-python/pull/12#discussion_r31951886"},"pull_request":{"href":"https://api.github.com/repos/openshift/sti-python/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/openshift/sti-python/pulls/12","id":34914787,"html_url":"https://github.com/openshift/sti-python/pull/12","diff_url":"https://github.com/openshift/sti-python/pull/12.diff","patch_url":"https://github.com/openshift/sti-python/pull/12.patch","issue_url":"https://api.github.com/repos/openshift/sti-python/issues/12","number":12,"state":"open","locked":false,"title":"Build support for Django","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":"* Change `.sti/bin/assemble` script to support custom build tasks for Django apps\r\n* Test building Django apps with and without support for serving static files\r\n* Test for expected build failure (for repos missing both `setup.py` and `requirements.txt`)\r\n\r\n-------------\r\nGeneral comments:\r\n* Tests are rather simple, but very slow :cry: \r\n  * Test runtime doubled from about a minute to 2 minutes in my environment.\r\n  * Rebuilding the docker image on every run is too expensive for an iterative workflow.\r\n* No way to run single tests (well, except by commenting lines in the `run` script) -- maybe we lack a better test \"framework\"?\r\n\r\nThat said, I'd love to work on improving the tests next time I touch this -- for now, I'm focusing on adding the bits to support a smooth deploy of Django apps with OpenShift.","created_at":"2015-05-07T13:24:47Z","updated_at":"2015-06-08T19:48:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9eba5a0dcf660df5df1dcb92f9c74c4bd40a2878","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openshift/sti-python/pulls/12/commits","review_comments_url":"https://api.github.com/repos/openshift/sti-python/pulls/12/comments","review_comment_url":"https://api.github.com/repos/openshift/sti-python/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openshift/sti-python/issues/12/comments","statuses_url":"https://api.github.com/repos/openshift/sti-python/statuses/f505e6434264b1c4c48189afc161c9796b237959","head":{"label":"rhcarvalho:django-support","ref":"django-support","sha":"f505e6434264b1c4c48189afc161c9796b237959","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":34122248,"name":"sti-python","full_name":"rhcarvalho/sti-python","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/sti-python","description":"","fork":true,"url":"https://api.github.com/repos/rhcarvalho/sti-python","forks_url":"https://api.github.com/repos/rhcarvalho/sti-python/forks","keys_url":"https://api.github.com/repos/rhcarvalho/sti-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rhcarvalho/sti-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rhcarvalho/sti-python/teams","hooks_url":"https://api.github.com/repos/rhcarvalho/sti-python/hooks","issue_events_url":"https://api.github.com/repos/rhcarvalho/sti-python/issues/events{/number}","events_url":"https://api.github.com/repos/rhcarvalho/sti-python/events","assignees_url":"https://api.github.com/repos/rhcarvalho/sti-python/assignees{/user}","branches_url":"https://api.github.com/repos/rhcarvalho/sti-python/branches{/branch}","tags_url":"https://api.github.com/repos/rhcarvalho/sti-python/tags","blobs_url":"https://api.github.com/repos/rhcarvalho/sti-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rhcarvalho/sti-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rhcarvalho/sti-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/rhcarvalho/sti-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rhcarvalho/sti-python/statuses/{sha}","languages_url":"https://api.github.com/repos/rhcarvalho/sti-python/languages","stargazers_url":"https://api.github.com/repos/rhcarvalho/sti-python/stargazers","contributors_url":"https://api.github.com/repos/rhcarvalho/sti-python/contributors","subscribers_url":"https://api.github.com/repos/rhcarvalho/sti-python/subscribers","subscription_url":"https://api.github.com/repos/rhcarvalho/sti-python/subscription","commits_url":"https://api.github.com/repos/rhcarvalho/sti-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/rhcarvalho/sti-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/rhcarvalho/sti-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/rhcarvalho/sti-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/rhcarvalho/sti-python/contents/{+path}","compare_url":"https://api.github.com/repos/rhcarvalho/sti-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rhcarvalho/sti-python/merges","archive_url":"https://api.github.com/repos/rhcarvalho/sti-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rhcarvalho/sti-python/downloads","issues_url":"https://api.github.com/repos/rhcarvalho/sti-python/issues{/number}","pulls_url":"https://api.github.com/repos/rhcarvalho/sti-python/pulls{/number}","milestones_url":"https://api.github.com/repos/rhcarvalho/sti-python/milestones{/number}","notifications_url":"https://api.github.com/repos/rhcarvalho/sti-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rhcarvalho/sti-python/labels{/name}","releases_url":"https://api.github.com/repos/rhcarvalho/sti-python/releases{/id}","created_at":"2015-04-17T14:49:43Z","updated_at":"2015-05-04T11:28:31Z","pushed_at":"2015-06-08T19:45:41Z","git_url":"git://github.com/rhcarvalho/sti-python.git","ssh_url":"git@github.com:rhcarvalho/sti-python.git","clone_url":"https://github.com/rhcarvalho/sti-python.git","svn_url":"https://github.com/rhcarvalho/sti-python","homepage":null,"size":218,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"08cf1129759306f83199dbfea59fd4276b9a7868","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":32732089,"name":"sti-python","full_name":"openshift/sti-python","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/sti-python","description":"","fork":false,"url":"https://api.github.com/repos/openshift/sti-python","forks_url":"https://api.github.com/repos/openshift/sti-python/forks","keys_url":"https://api.github.com/repos/openshift/sti-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openshift/sti-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openshift/sti-python/teams","hooks_url":"https://api.github.com/repos/openshift/sti-python/hooks","issue_events_url":"https://api.github.com/repos/openshift/sti-python/issues/events{/number}","events_url":"https://api.github.com/repos/openshift/sti-python/events","assignees_url":"https://api.github.com/repos/openshift/sti-python/assignees{/user}","branches_url":"https://api.github.com/repos/openshift/sti-python/branches{/branch}","tags_url":"https://api.github.com/repos/openshift/sti-python/tags","blobs_url":"https://api.github.com/repos/openshift/sti-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openshift/sti-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openshift/sti-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/openshift/sti-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openshift/sti-python/statuses/{sha}","languages_url":"https://api.github.com/repos/openshift/sti-python/languages","stargazers_url":"https://api.github.com/repos/openshift/sti-python/stargazers","contributors_url":"https://api.github.com/repos/openshift/sti-python/contributors","subscribers_url":"https://api.github.com/repos/openshift/sti-python/subscribers","subscription_url":"https://api.github.com/repos/openshift/sti-python/subscription","commits_url":"https://api.github.com/repos/openshift/sti-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/openshift/sti-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/openshift/sti-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/openshift/sti-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/openshift/sti-python/contents/{+path}","compare_url":"https://api.github.com/repos/openshift/sti-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openshift/sti-python/merges","archive_url":"https://api.github.com/repos/openshift/sti-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openshift/sti-python/downloads","issues_url":"https://api.github.com/repos/openshift/sti-python/issues{/number}","pulls_url":"https://api.github.com/repos/openshift/sti-python/pulls{/number}","milestones_url":"https://api.github.com/repos/openshift/sti-python/milestones{/number}","notifications_url":"https://api.github.com/repos/openshift/sti-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openshift/sti-python/labels{/name}","releases_url":"https://api.github.com/repos/openshift/sti-python/releases{/id}","created_at":"2015-03-23T12:53:52Z","updated_at":"2015-05-07T19:47:07Z","pushed_at":"2015-06-08T19:45:42Z","git_url":"git://github.com/openshift/sti-python.git","ssh_url":"git@github.com:openshift/sti-python.git","clone_url":"https://github.com/openshift/sti-python.git","svn_url":"https://github.com/openshift/sti-python","homepage":null,"size":422,"stargazers_count":2,"watchers_count":2,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":2,"forks":7,"open_issues":2,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openshift/sti-python/pulls/12"},"html":{"href":"https://github.com/openshift/sti-python/pull/12"},"issue":{"href":"https://api.github.com/repos/openshift/sti-python/issues/12"},"comments":{"href":"https://api.github.com/repos/openshift/sti-python/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/openshift/sti-python/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/openshift/sti-python/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openshift/sti-python/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/openshift/sti-python/statuses/f505e6434264b1c4c48189afc161c9796b237959"}}}}