{"action":"opened","number":6,"pull_request":{"url":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/pulls/6","id":77161171,"html_url":"https://github.com/ubuntudesign/developer.ubuntu.com/pull/6","diff_url":"https://github.com/ubuntudesign/developer.ubuntu.com/pull/6.diff","patch_url":"https://github.com/ubuntudesign/developer.ubuntu.com/pull/6.patch","issue_url":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/issues/6","number":6,"state":"open","locked":false,"title":"Store CMS media in Swift","user":{"login":"nottrobin","id":519935,"avatar_url":"https://avatars.githubusercontent.com/u/519935?v=3","gravatar_id":"","url":"https://api.github.com/users/nottrobin","html_url":"https://github.com/nottrobin","followers_url":"https://api.github.com/users/nottrobin/followers","following_url":"https://api.github.com/users/nottrobin/following{/other_user}","gists_url":"https://api.github.com/users/nottrobin/gists{/gist_id}","starred_url":"https://api.github.com/users/nottrobin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nottrobin/subscriptions","organizations_url":"https://api.github.com/users/nottrobin/orgs","repos_url":"https://api.github.com/users/nottrobin/repos","events_url":"https://api.github.com/users/nottrobin/events{/privacy}","received_events_url":"https://api.github.com/users/nottrobin/received_events","type":"User","site_admin":false},"body":"- Add settings to store CMS media assets under `/media`\n- If `OS_TENANT_NAME`, `OS_AUTH_URL`, `OS_USERNAME`, `OS_PASSWORD` and `OS_REGION_NAME` are provided, use these to connect to swift\n- If swift credentials are missing, throw an error, unless in debug mode\n- If in debug mode and no swift creds are provided, use local `media` directory\n\nQA\n---\n\n\n```\nmake run\n```\n\n\nYou should see \"No swift credentials found. Using local `media` directory for CMS media.\"\n\n```\nDJANGO_DEBUG=false make run\n```\n\nYou should see \"EnvironmentError: [ERROR]: No swift credentials found - required for CMS media.\"\n\n\nFind your swift credentials in `novarc` in your [canonistack credentials](https://enigma.admin.canonical.com/user/+me/canonistack-credentials.zip).\n\nNow add the `OS_` environment variables from the `novarc` file to the `.env` file inside developer.ubuntu.com, and remove any `\"` quotation marks, so it looks like this:\n\n``` bash\nPORT=8017\nDB=true\nOS_USERNAME=robin\nOS_TENANT_NAME=robin_project\nOS_PASSWORD=xxxxxxxx\nOS_AUTH_URL=https://keystone.canonistack.canonical.com:443/v2.0/\nOS_REGION_NAME=lcy01\n```\n\nNow get inside the Django container:\n\n``` bash\nmake \"docker-compose run --service-ports --entrypoint /bin/bash webapp\"\n```\n\nNow import all docs data:\n\n``` bash\n./update_apidocs.sh\n```\n\nLet it run for about 30 seconds then cancel it. Quit the image, and run:\n\n``` bash\nrm -rf media  # Delete any local media to make sure its definitely using swift\nmake run      # Run the server\n```\n\nCheck you see \"Swift credentials found\".\n\nWhen the server starts up again, visit http://127.0.0.1:8017/media/api/apps/qml/sdk-15.04.5/QtQml.Qt/images/declarative-rect_tint.png and check it exists.","created_at":"2016-07-12T17:48:40Z","updated_at":"2016-07-12T17:48:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/pulls/6/commits","review_comments_url":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/pulls/6/comments","review_comment_url":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/issues/6/comments","statuses_url":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/statuses/af4ba92c3efb232aa09dee9570366e098c96035b","head":{"label":"nottrobin:media-swift-storage","ref":"media-swift-storage","sha":"af4ba92c3efb232aa09dee9570366e098c96035b","user":{"login":"nottrobin","id":519935,"avatar_url":"https://avatars.githubusercontent.com/u/519935?v=3","gravatar_id":"","url":"https://api.github.com/users/nottrobin","html_url":"https://github.com/nottrobin","followers_url":"https://api.github.com/users/nottrobin/followers","following_url":"https://api.github.com/users/nottrobin/following{/other_user}","gists_url":"https://api.github.com/users/nottrobin/gists{/gist_id}","starred_url":"https://api.github.com/users/nottrobin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nottrobin/subscriptions","organizations_url":"https://api.github.com/users/nottrobin/orgs","repos_url":"https://api.github.com/users/nottrobin/repos","events_url":"https://api.github.com/users/nottrobin/events{/privacy}","received_events_url":"https://api.github.com/users/nottrobin/received_events","type":"User","site_admin":false},"repo":{"id":62260267,"name":"developer.ubuntu.com","full_name":"nottrobin/developer.ubuntu.com","owner":{"login":"nottrobin","id":519935,"avatar_url":"https://avatars.githubusercontent.com/u/519935?v=3","gravatar_id":"","url":"https://api.github.com/users/nottrobin","html_url":"https://github.com/nottrobin","followers_url":"https://api.github.com/users/nottrobin/followers","following_url":"https://api.github.com/users/nottrobin/following{/other_user}","gists_url":"https://api.github.com/users/nottrobin/gists{/gist_id}","starred_url":"https://api.github.com/users/nottrobin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nottrobin/subscriptions","organizations_url":"https://api.github.com/users/nottrobin/orgs","repos_url":"https://api.github.com/users/nottrobin/repos","events_url":"https://api.github.com/users/nottrobin/events{/privacy}","received_events_url":"https://api.github.com/users/nottrobin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nottrobin/developer.ubuntu.com","description":"The codebase for http://developer.ubuntu.com","fork":true,"url":"https://api.github.com/repos/nottrobin/developer.ubuntu.com","forks_url":"https://api.github.com/repos/nottrobin/developer.ubuntu.com/forks","keys_url":"https://api.github.com/repos/nottrobin/developer.ubuntu.com/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nottrobin/developer.ubuntu.com/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nottrobin/developer.ubuntu.com/teams","hooks_url":"https://api.github.com/repos/nottrobin/developer.ubuntu.com/hooks","issue_events_url":"https://api.github.com/repos/nottrobin/developer.ubuntu.com/issues/events{/number}","events_url":"https://api.github.com/repos/nottrobin/developer.ubuntu.com/events","assignees_url":"https://api.github.com/repos/nottrobin/developer.ubuntu.com/assignees{/user}","branches_url":"https://api.github.com/repos/nottrobin/developer.ubuntu.com/branches{/branch}","tags_url":"https://api.github.com/repos/nottrobin/developer.ubuntu.com/tags","blobs_url":"https://api.github.com/repos/nottrobin/developer.ubuntu.com/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nottrobin/developer.ubuntu.com/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nottrobin/developer.ubuntu.com/git/refs{/sha}","trees_url":"https://api.github.com/repos/nottrobin/developer.ubuntu.com/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nottrobin/developer.ubuntu.com/statuses/{sha}","languages_url":"https://api.github.com/repos/nottrobin/developer.ubuntu.com/languages","stargazers_url":"https://api.github.com/repos/nottrobin/developer.ubuntu.com/stargazers","contributors_url":"https://api.github.com/repos/nottrobin/developer.ubuntu.com/contributors","subscribers_url":"https://api.github.com/repos/nottrobin/developer.ubuntu.com/subscribers","subscription_url":"https://api.github.com/repos/nottrobin/developer.ubuntu.com/subscription","commits_url":"https://api.github.com/repos/nottrobin/developer.ubuntu.com/commits{/sha}","git_commits_url":"https://api.github.com/repos/nottrobin/developer.ubuntu.com/git/commits{/sha}","comments_url":"https://api.github.com/repos/nottrobin/developer.ubuntu.com/comments{/number}","issue_comment_url":"https://api.github.com/repos/nottrobin/developer.ubuntu.com/issues/comments{/number}","contents_url":"https://api.github.com/repos/nottrobin/developer.ubuntu.com/contents/{+path}","compare_url":"https://api.github.com/repos/nottrobin/developer.ubuntu.com/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nottrobin/developer.ubuntu.com/merges","archive_url":"https://api.github.com/repos/nottrobin/developer.ubuntu.com/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nottrobin/developer.ubuntu.com/downloads","issues_url":"https://api.github.com/repos/nottrobin/developer.ubuntu.com/issues{/number}","pulls_url":"https://api.github.com/repos/nottrobin/developer.ubuntu.com/pulls{/number}","milestones_url":"https://api.github.com/repos/nottrobin/developer.ubuntu.com/milestones{/number}","notifications_url":"https://api.github.com/repos/nottrobin/developer.ubuntu.com/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nottrobin/developer.ubuntu.com/labels{/name}","releases_url":"https://api.github.com/repos/nottrobin/developer.ubuntu.com/releases{/id}","deployments_url":"https://api.github.com/repos/nottrobin/developer.ubuntu.com/deployments","created_at":"2016-06-29T21:51:05Z","updated_at":"2016-06-29T21:51:08Z","pushed_at":"2016-07-12T16:08:10Z","git_url":"git://github.com/nottrobin/developer.ubuntu.com.git","ssh_url":"git@github.com:nottrobin/developer.ubuntu.com.git","clone_url":"https://github.com/nottrobin/developer.ubuntu.com.git","svn_url":"https://github.com/nottrobin/developer.ubuntu.com","homepage":null,"size":862,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"ubuntudesign:master","ref":"master","sha":"c02435c836d186167bf133add1d408e80b164401","user":{"login":"ubuntudesign","id":8777739,"avatar_url":"https://avatars.githubusercontent.com/u/8777739?v=3","gravatar_id":"","url":"https://api.github.com/users/ubuntudesign","html_url":"https://github.com/ubuntudesign","followers_url":"https://api.github.com/users/ubuntudesign/followers","following_url":"https://api.github.com/users/ubuntudesign/following{/other_user}","gists_url":"https://api.github.com/users/ubuntudesign/gists{/gist_id}","starred_url":"https://api.github.com/users/ubuntudesign/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ubuntudesign/subscriptions","organizations_url":"https://api.github.com/users/ubuntudesign/orgs","repos_url":"https://api.github.com/users/ubuntudesign/repos","events_url":"https://api.github.com/users/ubuntudesign/events{/privacy}","received_events_url":"https://api.github.com/users/ubuntudesign/received_events","type":"Organization","site_admin":false},"repo":{"id":59517512,"name":"developer.ubuntu.com","full_name":"ubuntudesign/developer.ubuntu.com","owner":{"login":"ubuntudesign","id":8777739,"avatar_url":"https://avatars.githubusercontent.com/u/8777739?v=3","gravatar_id":"","url":"https://api.github.com/users/ubuntudesign","html_url":"https://github.com/ubuntudesign","followers_url":"https://api.github.com/users/ubuntudesign/followers","following_url":"https://api.github.com/users/ubuntudesign/following{/other_user}","gists_url":"https://api.github.com/users/ubuntudesign/gists{/gist_id}","starred_url":"https://api.github.com/users/ubuntudesign/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ubuntudesign/subscriptions","organizations_url":"https://api.github.com/users/ubuntudesign/orgs","repos_url":"https://api.github.com/users/ubuntudesign/repos","events_url":"https://api.github.com/users/ubuntudesign/events{/privacy}","received_events_url":"https://api.github.com/users/ubuntudesign/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ubuntudesign/developer.ubuntu.com","description":"The codebase for http://developer.ubuntu.com","fork":false,"url":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com","forks_url":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/forks","keys_url":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/teams","hooks_url":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/hooks","issue_events_url":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/issues/events{/number}","events_url":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/events","assignees_url":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/assignees{/user}","branches_url":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/branches{/branch}","tags_url":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/tags","blobs_url":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/git/refs{/sha}","trees_url":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/statuses/{sha}","languages_url":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/languages","stargazers_url":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/stargazers","contributors_url":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/contributors","subscribers_url":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/subscribers","subscription_url":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/subscription","commits_url":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/commits{/sha}","git_commits_url":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/git/commits{/sha}","comments_url":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/comments{/number}","issue_comment_url":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/issues/comments{/number}","contents_url":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/contents/{+path}","compare_url":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/merges","archive_url":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/downloads","issues_url":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/issues{/number}","pulls_url":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/pulls{/number}","milestones_url":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/milestones{/number}","notifications_url":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/labels{/name}","releases_url":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/releases{/id}","deployments_url":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/deployments","created_at":"2016-05-23T20:51:30Z","updated_at":"2016-06-03T15:39:19Z","pushed_at":"2016-07-12T17:48:40Z","git_url":"git://github.com/ubuntudesign/developer.ubuntu.com.git","ssh_url":"git@github.com:ubuntudesign/developer.ubuntu.com.git","clone_url":"https://github.com/ubuntudesign/developer.ubuntu.com.git","svn_url":"https://github.com/ubuntudesign/developer.ubuntu.com","homepage":null,"size":868,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":2,"forks":2,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/pulls/6"},"html":{"href":"https://github.com/ubuntudesign/developer.ubuntu.com/pull/6"},"issue":{"href":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/issues/6"},"comments":{"href":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/ubuntudesign/developer.ubuntu.com/statuses/af4ba92c3efb232aa09dee9570366e098c96035b"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":9,"additions":159,"deletions":225,"changed_files":8}}
{"actor":{"display_login":"nottrobin"}}