{"action":"created","comment":{"url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/comments/56311815","id":56311815,"diff_hunk":"@@ -0,0 +1,415 @@\n+#!/usr/bin/env python","path":"scripts/s3manage.py","position":1,"original_position":1,"commit_id":"f953c8c51844233dff8cfcb72d7533aec2ee39cc","original_commit_id":"0ce2446c99cf177677ad91a19b4b7662163e460e","user":{"login":"loicgasser","id":3306154,"avatar_url":"https://avatars.githubusercontent.com/u/3306154?v=3","gravatar_id":"","url":"https://api.github.com/users/loicgasser","html_url":"https://github.com/loicgasser","followers_url":"https://api.github.com/users/loicgasser/followers","following_url":"https://api.github.com/users/loicgasser/following{/other_user}","gists_url":"https://api.github.com/users/loicgasser/gists{/gist_id}","starred_url":"https://api.github.com/users/loicgasser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loicgasser/subscriptions","organizations_url":"https://api.github.com/users/loicgasser/orgs","repos_url":"https://api.github.com/users/loicgasser/repos","events_url":"https://api.github.com/users/loicgasser/events{/privacy}","received_events_url":"https://api.github.com/users/loicgasser/received_events","type":"User","site_admin":false},"body":"ok so after a `source .../bin/activate`\r\nYou can do `scripts/s3manage.py {command}`\r\n\r\nIn makefile you'r always using ${PYTHON_CMD} I'm not sure which one is used in that case...","created_at":"2016-03-16T10:35:18Z","updated_at":"2016-03-16T10:35:18Z","html_url":"https://github.com/geoadmin/mf-geoadmin3/pull/3142#discussion_r56311815","pull_request_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/3142","_links":{"self":{"href":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/comments/56311815"},"html":{"href":"https://github.com/geoadmin/mf-geoadmin3/pull/3142#discussion_r56311815"},"pull_request":{"href":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/3142"}}},"pull_request":{"url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/3142","id":59362338,"html_url":"https://github.com/geoadmin/mf-geoadmin3/pull/3142","diff_url":"https://github.com/geoadmin/mf-geoadmin3/pull/3142.diff","patch_url":"https://github.com/geoadmin/mf-geoadmin3/pull/3142.patch","issue_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/issues/3142","number":3142,"state":"open","locked":false,"title":"Deploy and manage geoadmin on AWS S3","user":{"login":"procrastinatio","id":1236739,"avatar_url":"https://avatars.githubusercontent.com/u/1236739?v=3","gravatar_id":"","url":"https://api.github.com/users/procrastinatio","html_url":"https://github.com/procrastinatio","followers_url":"https://api.github.com/users/procrastinatio/followers","following_url":"https://api.github.com/users/procrastinatio/following{/other_user}","gists_url":"https://api.github.com/users/procrastinatio/gists{/gist_id}","starred_url":"https://api.github.com/users/procrastinatio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/procrastinatio/subscriptions","organizations_url":"https://api.github.com/users/procrastinatio/orgs","repos_url":"https://api.github.com/users/procrastinatio/repos","events_url":"https://api.github.com/users/procrastinatio/events{/privacy}","received_events_url":"https://api.github.com/users/procrastinatio/received_events","type":"User","site_admin":false},"body":"This PR adds a script to deploy static versions of geoadmin to an AWS bucket. Many versions may live together in the bucket, but only one is the active one (i.e. running at the _root_).\r\n\r\n**Currently**, we use a code **snapshot**, which is only a isolated copy of code as basis for deploy. Deploy will **build** geoadmin on every hosts it is deployed to.\r\n\r\nWith **this PR**, you have to **build** geoadmin with the correct settings, before deploying. Deplyoing does nothing but copying files to S3. Check the _prd/info.json_ file to see the used settings.\r\n\r\n\r\nSee the [README.md](https://github.com/geoadmin/mf-geoadmin3/blob/mom_layersconfig_lang/README.md)\r\n\r\n```\r\n{\r\n  \"branch\":\"mom_layersconfig_lang\",\r\n  \"version\": \"1456401810\",\r\n  \"api_url\": \"//mf-chsdi3.dev.bgdi.ch\",\r\n  \"last_commit_hash\":\"3beb581ccb1cd4d1367691843f581665b4c549cb\",\r\n  \"last_commit_date\":\"2016-02-25 12:54:56 +0100\",\r\n  \"user\": \"ltmom\",\r\n  \"build_date\": \"2016-02-25 12:03:30 +0000\"\r\n}\r\n```\r\n\r\nAddition to `Makefile`\r\n```\r\n- s3upload       Uploads current build to S3, from current dir if SNAPSHOT=xxx is not mentioned\r\n- s3activate     Activates version on S3 with VERSION=xxxxxxxxx\r\n- s3list         Lists uploaded version to S3\r\n- s3delete       Deletes version VERSION=xxxxxx on S3\r\n```\r\n\r\nResults\r\nVia **S3**\r\n[active version](https://s3-eu-central-1.amazonaws.com/mf-geoadmin3-prod-frankfurt/)\r\n[active version /src](https://s3-eu-central-1.amazonaws.com/mf-geoadmin3-prod-frankfurt/src)\r\n[random version, index.1458035776.html](https://s3-eu-central-1.amazonaws.com/mf-geoadmin3-prod-frankfurt/index.1458035776.html)\r\n\r\nIdem via **cloudfront**\r\n\r\n[active version](https://map2.geo.admin.ch/?lang=rm)\r\n[active version (/src) ](https://map2.geo.admin.ch/src?lang=it)\r\n\r\n\r\n\r\nAu final, les vhosts suivant:\r\n- mf-geoadmin3.dev-bgdi.ch  --> inchangé\r\n- mf-geoadmin3.int-bgdi.ch  -->  AWS S3 + CF\r\n- mf-geoadmin3.prod-bgdi.ch  --> AWS S3 + CF\r\n\r\nSee https://github.com/geoadmin/mf-geoadmin3/issues/3092","created_at":"2016-02-15T13:17:17Z","updated_at":"2016-03-16T10:35:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f835277fe1f8f5b0f9db4b4d5358f5b167d7910c","assignee":{"login":"gjn","id":2572317,"avatar_url":"https://avatars.githubusercontent.com/u/2572317?v=3","gravatar_id":"","url":"https://api.github.com/users/gjn","html_url":"https://github.com/gjn","followers_url":"https://api.github.com/users/gjn/followers","following_url":"https://api.github.com/users/gjn/following{/other_user}","gists_url":"https://api.github.com/users/gjn/gists{/gist_id}","starred_url":"https://api.github.com/users/gjn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gjn/subscriptions","organizations_url":"https://api.github.com/users/gjn/orgs","repos_url":"https://api.github.com/users/gjn/repos","events_url":"https://api.github.com/users/gjn/events{/privacy}","received_events_url":"https://api.github.com/users/gjn/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/3142/commits","review_comments_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/3142/comments","review_comment_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/comments{/number}","comments_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/issues/3142/comments","statuses_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/statuses/f953c8c51844233dff8cfcb72d7533aec2ee39cc","head":{"label":"geoadmin:mom_layersconfig_lang","ref":"mom_layersconfig_lang","sha":"f953c8c51844233dff8cfcb72d7533aec2ee39cc","user":{"login":"geoadmin","id":3369793,"avatar_url":"https://avatars.githubusercontent.com/u/3369793?v=3","gravatar_id":"","url":"https://api.github.com/users/geoadmin","html_url":"https://github.com/geoadmin","followers_url":"https://api.github.com/users/geoadmin/followers","following_url":"https://api.github.com/users/geoadmin/following{/other_user}","gists_url":"https://api.github.com/users/geoadmin/gists{/gist_id}","starred_url":"https://api.github.com/users/geoadmin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geoadmin/subscriptions","organizations_url":"https://api.github.com/users/geoadmin/orgs","repos_url":"https://api.github.com/users/geoadmin/repos","events_url":"https://api.github.com/users/geoadmin/events{/privacy}","received_events_url":"https://api.github.com/users/geoadmin/received_events","type":"Organization","site_admin":false},"repo":{"id":10399273,"name":"mf-geoadmin3","full_name":"geoadmin/mf-geoadmin3","owner":{"login":"geoadmin","id":3369793,"avatar_url":"https://avatars.githubusercontent.com/u/3369793?v=3","gravatar_id":"","url":"https://api.github.com/users/geoadmin","html_url":"https://github.com/geoadmin","followers_url":"https://api.github.com/users/geoadmin/followers","following_url":"https://api.github.com/users/geoadmin/following{/other_user}","gists_url":"https://api.github.com/users/geoadmin/gists{/gist_id}","starred_url":"https://api.github.com/users/geoadmin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geoadmin/subscriptions","organizations_url":"https://api.github.com/users/geoadmin/orgs","repos_url":"https://api.github.com/users/geoadmin/repos","events_url":"https://api.github.com/users/geoadmin/events{/privacy}","received_events_url":"https://api.github.com/users/geoadmin/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/geoadmin/mf-geoadmin3","description":"map.geo.admin.ch source code","fork":false,"url":"https://api.github.com/repos/geoadmin/mf-geoadmin3","forks_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/forks","keys_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/teams","hooks_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/hooks","issue_events_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/issues/events{/number}","events_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/events","assignees_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/assignees{/user}","branches_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/branches{/branch}","tags_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/tags","blobs_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/git/refs{/sha}","trees_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/statuses/{sha}","languages_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/languages","stargazers_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/stargazers","contributors_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/contributors","subscribers_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/subscribers","subscription_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/subscription","commits_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/commits{/sha}","git_commits_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/git/commits{/sha}","comments_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/comments{/number}","issue_comment_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/issues/comments{/number}","contents_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/contents/{+path}","compare_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/merges","archive_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/downloads","issues_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/issues{/number}","pulls_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls{/number}","milestones_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/milestones{/number}","notifications_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/labels{/name}","releases_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/releases{/id}","deployments_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/deployments","created_at":"2013-05-31T06:37:20Z","updated_at":"2016-03-02T16:31:25Z","pushed_at":"2016-03-16T10:21:31Z","git_url":"git://github.com/geoadmin/mf-geoadmin3.git","ssh_url":"git@github.com:geoadmin/mf-geoadmin3.git","clone_url":"https://github.com/geoadmin/mf-geoadmin3.git","svn_url":"https://github.com/geoadmin/mf-geoadmin3","homepage":"http://map.geo.admin.ch","size":59590,"stargazers_count":86,"watchers_count":86,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":41,"mirror_url":null,"open_issues_count":112,"forks":41,"open_issues":112,"watchers":86,"default_branch":"master"}},"base":{"label":"geoadmin:master","ref":"master","sha":"940d68eee176b09182cb6bcb755177738e95caf2","user":{"login":"geoadmin","id":3369793,"avatar_url":"https://avatars.githubusercontent.com/u/3369793?v=3","gravatar_id":"","url":"https://api.github.com/users/geoadmin","html_url":"https://github.com/geoadmin","followers_url":"https://api.github.com/users/geoadmin/followers","following_url":"https://api.github.com/users/geoadmin/following{/other_user}","gists_url":"https://api.github.com/users/geoadmin/gists{/gist_id}","starred_url":"https://api.github.com/users/geoadmin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geoadmin/subscriptions","organizations_url":"https://api.github.com/users/geoadmin/orgs","repos_url":"https://api.github.com/users/geoadmin/repos","events_url":"https://api.github.com/users/geoadmin/events{/privacy}","received_events_url":"https://api.github.com/users/geoadmin/received_events","type":"Organization","site_admin":false},"repo":{"id":10399273,"name":"mf-geoadmin3","full_name":"geoadmin/mf-geoadmin3","owner":{"login":"geoadmin","id":3369793,"avatar_url":"https://avatars.githubusercontent.com/u/3369793?v=3","gravatar_id":"","url":"https://api.github.com/users/geoadmin","html_url":"https://github.com/geoadmin","followers_url":"https://api.github.com/users/geoadmin/followers","following_url":"https://api.github.com/users/geoadmin/following{/other_user}","gists_url":"https://api.github.com/users/geoadmin/gists{/gist_id}","starred_url":"https://api.github.com/users/geoadmin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geoadmin/subscriptions","organizations_url":"https://api.github.com/users/geoadmin/orgs","repos_url":"https://api.github.com/users/geoadmin/repos","events_url":"https://api.github.com/users/geoadmin/events{/privacy}","received_events_url":"https://api.github.com/users/geoadmin/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/geoadmin/mf-geoadmin3","description":"map.geo.admin.ch source code","fork":false,"url":"https://api.github.com/repos/geoadmin/mf-geoadmin3","forks_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/forks","keys_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/teams","hooks_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/hooks","issue_events_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/issues/events{/number}","events_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/events","assignees_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/assignees{/user}","branches_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/branches{/branch}","tags_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/tags","blobs_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/git/refs{/sha}","trees_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/statuses/{sha}","languages_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/languages","stargazers_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/stargazers","contributors_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/contributors","subscribers_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/subscribers","subscription_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/subscription","commits_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/commits{/sha}","git_commits_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/git/commits{/sha}","comments_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/comments{/number}","issue_comment_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/issues/comments{/number}","contents_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/contents/{+path}","compare_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/merges","archive_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/downloads","issues_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/issues{/number}","pulls_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls{/number}","milestones_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/milestones{/number}","notifications_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/labels{/name}","releases_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/releases{/id}","deployments_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/deployments","created_at":"2013-05-31T06:37:20Z","updated_at":"2016-03-02T16:31:25Z","pushed_at":"2016-03-16T10:21:31Z","git_url":"git://github.com/geoadmin/mf-geoadmin3.git","ssh_url":"git@github.com:geoadmin/mf-geoadmin3.git","clone_url":"https://github.com/geoadmin/mf-geoadmin3.git","svn_url":"https://github.com/geoadmin/mf-geoadmin3","homepage":"http://map.geo.admin.ch","size":59590,"stargazers_count":86,"watchers_count":86,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":41,"mirror_url":null,"open_issues_count":112,"forks":41,"open_issues":112,"watchers":86,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/3142"},"html":{"href":"https://github.com/geoadmin/mf-geoadmin3/pull/3142"},"issue":{"href":"https://api.github.com/repos/geoadmin/mf-geoadmin3/issues/3142"},"comments":{"href":"https://api.github.com/repos/geoadmin/mf-geoadmin3/issues/3142/comments"},"review_comments":{"href":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/3142/comments"},"review_comment":{"href":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/3142/commits"},"statuses":{"href":"https://api.github.com/repos/geoadmin/mf-geoadmin3/statuses/f953c8c51844233dff8cfcb72d7533aec2ee39cc"}}}}