{"action":"created","comment":{"url":"https://api.github.com/repos/input-output-hk/iohk-ops/pulls/comments/152280655","pull_request_review_id":78112313,"id":152280655,"diff_hunk":"@@ -858,6 +885,72 @@ date o c = parallelIO o c $\n   \\n -> ssh' o c \"date\" [] n\n   (\\out -> TIO.putStrLn $ fromNodeName n <> \": \" <> out)\n \n+\n+s3Upload :: T.Text -> NixopsConfig -> IO ()\n+s3Upload daedalus_rev c = do\n+  let\n+    say = liftIO . TIO.putStrLn\n+    uploadOneFile :: BucketName -> T.Text -> ObjectKey -> Integer -> T.Text -> AWST (ResourceT IO) ()\n+    uploadOneFile bucketName localPath remoteKey appver cardanoCommit = do\n+      bdy <- chunkedFile defaultChunkSize (T.unpack localPath)\n+      let\n+        newMetaData :: HMS.HashMap Text Text\n+        newMetaData = HMS.fromList [\n+              (\"daedalus-revision\", daedalus_rev)\n+            , (\"cardano-revision\", cardanoCommit)\n+            , (\"application-version\", (T.pack. show) appver)\n+          ]\n+      void . send $ Lens.set poACL (Just OPublicRead) $ Lens.set poMetadata newMetaData $ putObject bucketName remoteKey bdy\n+    copyObject' :: BucketName -> T.Text -> ObjectKey -> AWST (ResourceT IO) ()\n+    copyObject' bucketName source dest = void . send $ Lens.set coACL (Just OPublicRead) $ copyObject bucketName source dest\n+    uploadHashedInstaller :: T.Text -> T.Text -> Integer -> T.Text -> AWST (ResourceT IO) T.Text\n+    uploadHashedInstaller bucketName localPath appver cardanoCommit = do\n+      hash <- (liftIO . hashInstaller) localPath\n+      let\n+        basename' = last $ T.splitOn \"/\" $ localPath\n+      liftIO $ print localPath\n+      liftIO $ print basename'\n+      uploadOneFile (BucketName bucketName) localPath (ObjectKey hash) appver cardanoCommit\n+      copyObject' (BucketName bucketName) (bucketName <> \"/\" <> hash) (ObjectKey basename')\n+      return hash\n+    hashAndUpload :: Integer -> T.Text -> CiResult -> AWST (ResourceT IO) ()\n+    hashAndUpload appver cardanoCommit ciResult = do\n+      case ciResult of\n+        TravisResult localPath _ _ _ _ -> do\n+          hash <- uploadHashedInstaller (cUpdateBucket c) localPath appver cardanoCommit\n+          say $ \"darwin installer \" <> localPath <> \" hash \" <> hash\n+        AppveyorResult localPath _ _ -> do\n+          hash <- uploadHashedInstaller (cUpdateBucket c) localPath appver cardanoCommit\n+          say $ \"windows installer \" <> localPath <> \" hash \" <> hash\n+\n+  --lgr <- newLogger Trace Sys.stdout\n+  env <- newEnv Discover -- <&> set envLogger lgr -- . set envRegion NorthVirginia","path":"iohk/NixOps.hs","position":147,"original_position":147,"commit_id":"8741ae67059ae9ed46b7aa414f8239ef27d92618","original_commit_id":"8741ae67059ae9ed46b7aa414f8239ef27d92618","user":{"login":"adinapoli-iohk","id":29383371,"avatar_url":"https://avatars3.githubusercontent.com/u/29383371?v=4","gravatar_id":"","url":"https://api.github.com/users/adinapoli-iohk","html_url":"https://github.com/adinapoli-iohk","followers_url":"https://api.github.com/users/adinapoli-iohk/followers","following_url":"https://api.github.com/users/adinapoli-iohk/following{/other_user}","gists_url":"https://api.github.com/users/adinapoli-iohk/gists{/gist_id}","starred_url":"https://api.github.com/users/adinapoli-iohk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adinapoli-iohk/subscriptions","organizations_url":"https://api.github.com/users/adinapoli-iohk/orgs","repos_url":"https://api.github.com/users/adinapoli-iohk/repos","events_url":"https://api.github.com/users/adinapoli-iohk/events{/privacy}","received_events_url":"https://api.github.com/users/adinapoli-iohk/received_events","type":"User","site_admin":false},"body":"More debugging leftovers?","created_at":"2017-11-21T13:55:07Z","updated_at":"2017-11-21T13:58:42Z","html_url":"https://github.com/input-output-hk/iohk-ops/pull/183#discussion_r152280655","pull_request_url":"https://api.github.com/repos/input-output-hk/iohk-ops/pulls/183","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/input-output-hk/iohk-ops/pulls/comments/152280655"},"html":{"href":"https://github.com/input-output-hk/iohk-ops/pull/183#discussion_r152280655"},"pull_request":{"href":"https://api.github.com/repos/input-output-hk/iohk-ops/pulls/183"}}},"pull_request":{"url":"https://api.github.com/repos/input-output-hk/iohk-ops/pulls/183","id":148924091,"html_url":"https://github.com/input-output-hk/iohk-ops/pull/183","diff_url":"https://github.com/input-output-hk/iohk-ops/pull/183.diff","patch_url":"https://github.com/input-output-hk/iohk-ops/pull/183.patch","issue_url":"https://api.github.com/repos/input-output-hk/iohk-ops/issues/183","number":183,"state":"open","locked":false,"title":"[DEVOPS-463] allow iohk-ops to upload installers","user":{"login":"cleverca22","id":848609,"avatar_url":"https://avatars1.githubusercontent.com/u/848609?v=4","gravatar_id":"","url":"https://api.github.com/users/cleverca22","html_url":"https://github.com/cleverca22","followers_url":"https://api.github.com/users/cleverca22/followers","following_url":"https://api.github.com/users/cleverca22/following{/other_user}","gists_url":"https://api.github.com/users/cleverca22/gists{/gist_id}","starred_url":"https://api.github.com/users/cleverca22/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cleverca22/subscriptions","organizations_url":"https://api.github.com/users/cleverca22/orgs","repos_url":"https://api.github.com/users/cleverca22/repos","events_url":"https://api.github.com/users/cleverca22/events{/privacy}","received_events_url":"https://api.github.com/users/cleverca22/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-10-26T12:45:50Z","updated_at":"2017-11-21T13:58:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"aaff8a6639754045587b5a34090c7d6f5508f1a7","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/input-output-hk/iohk-ops/pulls/183/commits","review_comments_url":"https://api.github.com/repos/input-output-hk/iohk-ops/pulls/183/comments","review_comment_url":"https://api.github.com/repos/input-output-hk/iohk-ops/pulls/comments{/number}","comments_url":"https://api.github.com/repos/input-output-hk/iohk-ops/issues/183/comments","statuses_url":"https://api.github.com/repos/input-output-hk/iohk-ops/statuses/8741ae67059ae9ed46b7aa414f8239ef27d92618","head":{"label":"input-output-hk:devops-463","ref":"devops-463","sha":"8741ae67059ae9ed46b7aa414f8239ef27d92618","user":{"login":"input-output-hk","id":12909177,"avatar_url":"https://avatars3.githubusercontent.com/u/12909177?v=4","gravatar_id":"","url":"https://api.github.com/users/input-output-hk","html_url":"https://github.com/input-output-hk","followers_url":"https://api.github.com/users/input-output-hk/followers","following_url":"https://api.github.com/users/input-output-hk/following{/other_user}","gists_url":"https://api.github.com/users/input-output-hk/gists{/gist_id}","starred_url":"https://api.github.com/users/input-output-hk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/input-output-hk/subscriptions","organizations_url":"https://api.github.com/users/input-output-hk/orgs","repos_url":"https://api.github.com/users/input-output-hk/repos","events_url":"https://api.github.com/users/input-output-hk/events{/privacy}","received_events_url":"https://api.github.com/users/input-output-hk/received_events","type":"Organization","site_admin":false},"repo":{"id":72148261,"name":"iohk-ops","full_name":"input-output-hk/iohk-ops","owner":{"login":"input-output-hk","id":12909177,"avatar_url":"https://avatars3.githubusercontent.com/u/12909177?v=4","gravatar_id":"","url":"https://api.github.com/users/input-output-hk","html_url":"https://github.com/input-output-hk","followers_url":"https://api.github.com/users/input-output-hk/followers","following_url":"https://api.github.com/users/input-output-hk/following{/other_user}","gists_url":"https://api.github.com/users/input-output-hk/gists{/gist_id}","starred_url":"https://api.github.com/users/input-output-hk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/input-output-hk/subscriptions","organizations_url":"https://api.github.com/users/input-output-hk/orgs","repos_url":"https://api.github.com/users/input-output-hk/repos","events_url":"https://api.github.com/users/input-output-hk/events{/privacy}","received_events_url":"https://api.github.com/users/input-output-hk/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/input-output-hk/iohk-ops","description":"NixOps deployment configuration for IOHK devops","fork":false,"url":"https://api.github.com/repos/input-output-hk/iohk-ops","forks_url":"https://api.github.com/repos/input-output-hk/iohk-ops/forks","keys_url":"https://api.github.com/repos/input-output-hk/iohk-ops/keys{/key_id}","collaborators_url":"https://api.github.com/repos/input-output-hk/iohk-ops/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/input-output-hk/iohk-ops/teams","hooks_url":"https://api.github.com/repos/input-output-hk/iohk-ops/hooks","issue_events_url":"https://api.github.com/repos/input-output-hk/iohk-ops/issues/events{/number}","events_url":"https://api.github.com/repos/input-output-hk/iohk-ops/events","assignees_url":"https://api.github.com/repos/input-output-hk/iohk-ops/assignees{/user}","branches_url":"https://api.github.com/repos/input-output-hk/iohk-ops/branches{/branch}","tags_url":"https://api.github.com/repos/input-output-hk/iohk-ops/tags","blobs_url":"https://api.github.com/repos/input-output-hk/iohk-ops/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/input-output-hk/iohk-ops/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/input-output-hk/iohk-ops/git/refs{/sha}","trees_url":"https://api.github.com/repos/input-output-hk/iohk-ops/git/trees{/sha}","statuses_url":"https://api.github.com/repos/input-output-hk/iohk-ops/statuses/{sha}","languages_url":"https://api.github.com/repos/input-output-hk/iohk-ops/languages","stargazers_url":"https://api.github.com/repos/input-output-hk/iohk-ops/stargazers","contributors_url":"https://api.github.com/repos/input-output-hk/iohk-ops/contributors","subscribers_url":"https://api.github.com/repos/input-output-hk/iohk-ops/subscribers","subscription_url":"https://api.github.com/repos/input-output-hk/iohk-ops/subscription","commits_url":"https://api.github.com/repos/input-output-hk/iohk-ops/commits{/sha}","git_commits_url":"https://api.github.com/repos/input-output-hk/iohk-ops/git/commits{/sha}","comments_url":"https://api.github.com/repos/input-output-hk/iohk-ops/comments{/number}","issue_comment_url":"https://api.github.com/repos/input-output-hk/iohk-ops/issues/comments{/number}","contents_url":"https://api.github.com/repos/input-output-hk/iohk-ops/contents/{+path}","compare_url":"https://api.github.com/repos/input-output-hk/iohk-ops/compare/{base}...{head}","merges_url":"https://api.github.com/repos/input-output-hk/iohk-ops/merges","archive_url":"https://api.github.com/repos/input-output-hk/iohk-ops/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/input-output-hk/iohk-ops/downloads","issues_url":"https://api.github.com/repos/input-output-hk/iohk-ops/issues{/number}","pulls_url":"https://api.github.com/repos/input-output-hk/iohk-ops/pulls{/number}","milestones_url":"https://api.github.com/repos/input-output-hk/iohk-ops/milestones{/number}","notifications_url":"https://api.github.com/repos/input-output-hk/iohk-ops/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/input-output-hk/iohk-ops/labels{/name}","releases_url":"https://api.github.com/repos/input-output-hk/iohk-ops/releases{/id}","deployments_url":"https://api.github.com/repos/input-output-hk/iohk-ops/deployments","created_at":"2016-10-27T21:05:29Z","updated_at":"2017-11-20T19:16:38Z","pushed_at":"2017-11-21T13:20:40Z","git_url":"git://github.com/input-output-hk/iohk-ops.git","ssh_url":"git@github.com:input-output-hk/iohk-ops.git","clone_url":"https://github.com/input-output-hk/iohk-ops.git","svn_url":"https://github.com/input-output-hk/iohk-ops","homepage":"","size":4757,"stargazers_count":27,"watchers_count":27,"language":"Haskell","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"archived":false,"open_issues_count":5,"forks":11,"open_issues":5,"watchers":27,"default_branch":"develop"}},"base":{"label":"input-output-hk:develop","ref":"develop","sha":"a25d2d9320f8b8f3515f1195d5fceba96fd24493","user":{"login":"input-output-hk","id":12909177,"avatar_url":"https://avatars3.githubusercontent.com/u/12909177?v=4","gravatar_id":"","url":"https://api.github.com/users/input-output-hk","html_url":"https://github.com/input-output-hk","followers_url":"https://api.github.com/users/input-output-hk/followers","following_url":"https://api.github.com/users/input-output-hk/following{/other_user}","gists_url":"https://api.github.com/users/input-output-hk/gists{/gist_id}","starred_url":"https://api.github.com/users/input-output-hk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/input-output-hk/subscriptions","organizations_url":"https://api.github.com/users/input-output-hk/orgs","repos_url":"https://api.github.com/users/input-output-hk/repos","events_url":"https://api.github.com/users/input-output-hk/events{/privacy}","received_events_url":"https://api.github.com/users/input-output-hk/received_events","type":"Organization","site_admin":false},"repo":{"id":72148261,"name":"iohk-ops","full_name":"input-output-hk/iohk-ops","owner":{"login":"input-output-hk","id":12909177,"avatar_url":"https://avatars3.githubusercontent.com/u/12909177?v=4","gravatar_id":"","url":"https://api.github.com/users/input-output-hk","html_url":"https://github.com/input-output-hk","followers_url":"https://api.github.com/users/input-output-hk/followers","following_url":"https://api.github.com/users/input-output-hk/following{/other_user}","gists_url":"https://api.github.com/users/input-output-hk/gists{/gist_id}","starred_url":"https://api.github.com/users/input-output-hk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/input-output-hk/subscriptions","organizations_url":"https://api.github.com/users/input-output-hk/orgs","repos_url":"https://api.github.com/users/input-output-hk/repos","events_url":"https://api.github.com/users/input-output-hk/events{/privacy}","received_events_url":"https://api.github.com/users/input-output-hk/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/input-output-hk/iohk-ops","description":"NixOps deployment configuration for IOHK devops","fork":false,"url":"https://api.github.com/repos/input-output-hk/iohk-ops","forks_url":"https://api.github.com/repos/input-output-hk/iohk-ops/forks","keys_url":"https://api.github.com/repos/input-output-hk/iohk-ops/keys{/key_id}","collaborators_url":"https://api.github.com/repos/input-output-hk/iohk-ops/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/input-output-hk/iohk-ops/teams","hooks_url":"https://api.github.com/repos/input-output-hk/iohk-ops/hooks","issue_events_url":"https://api.github.com/repos/input-output-hk/iohk-ops/issues/events{/number}","events_url":"https://api.github.com/repos/input-output-hk/iohk-ops/events","assignees_url":"https://api.github.com/repos/input-output-hk/iohk-ops/assignees{/user}","branches_url":"https://api.github.com/repos/input-output-hk/iohk-ops/branches{/branch}","tags_url":"https://api.github.com/repos/input-output-hk/iohk-ops/tags","blobs_url":"https://api.github.com/repos/input-output-hk/iohk-ops/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/input-output-hk/iohk-ops/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/input-output-hk/iohk-ops/git/refs{/sha}","trees_url":"https://api.github.com/repos/input-output-hk/iohk-ops/git/trees{/sha}","statuses_url":"https://api.github.com/repos/input-output-hk/iohk-ops/statuses/{sha}","languages_url":"https://api.github.com/repos/input-output-hk/iohk-ops/languages","stargazers_url":"https://api.github.com/repos/input-output-hk/iohk-ops/stargazers","contributors_url":"https://api.github.com/repos/input-output-hk/iohk-ops/contributors","subscribers_url":"https://api.github.com/repos/input-output-hk/iohk-ops/subscribers","subscription_url":"https://api.github.com/repos/input-output-hk/iohk-ops/subscription","commits_url":"https://api.github.com/repos/input-output-hk/iohk-ops/commits{/sha}","git_commits_url":"https://api.github.com/repos/input-output-hk/iohk-ops/git/commits{/sha}","comments_url":"https://api.github.com/repos/input-output-hk/iohk-ops/comments{/number}","issue_comment_url":"https://api.github.com/repos/input-output-hk/iohk-ops/issues/comments{/number}","contents_url":"https://api.github.com/repos/input-output-hk/iohk-ops/contents/{+path}","compare_url":"https://api.github.com/repos/input-output-hk/iohk-ops/compare/{base}...{head}","merges_url":"https://api.github.com/repos/input-output-hk/iohk-ops/merges","archive_url":"https://api.github.com/repos/input-output-hk/iohk-ops/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/input-output-hk/iohk-ops/downloads","issues_url":"https://api.github.com/repos/input-output-hk/iohk-ops/issues{/number}","pulls_url":"https://api.github.com/repos/input-output-hk/iohk-ops/pulls{/number}","milestones_url":"https://api.github.com/repos/input-output-hk/iohk-ops/milestones{/number}","notifications_url":"https://api.github.com/repos/input-output-hk/iohk-ops/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/input-output-hk/iohk-ops/labels{/name}","releases_url":"https://api.github.com/repos/input-output-hk/iohk-ops/releases{/id}","deployments_url":"https://api.github.com/repos/input-output-hk/iohk-ops/deployments","created_at":"2016-10-27T21:05:29Z","updated_at":"2017-11-20T19:16:38Z","pushed_at":"2017-11-21T13:20:40Z","git_url":"git://github.com/input-output-hk/iohk-ops.git","ssh_url":"git@github.com:input-output-hk/iohk-ops.git","clone_url":"https://github.com/input-output-hk/iohk-ops.git","svn_url":"https://github.com/input-output-hk/iohk-ops","homepage":"","size":4757,"stargazers_count":27,"watchers_count":27,"language":"Haskell","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"archived":false,"open_issues_count":5,"forks":11,"open_issues":5,"watchers":27,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/input-output-hk/iohk-ops/pulls/183"},"html":{"href":"https://github.com/input-output-hk/iohk-ops/pull/183"},"issue":{"href":"https://api.github.com/repos/input-output-hk/iohk-ops/issues/183"},"comments":{"href":"https://api.github.com/repos/input-output-hk/iohk-ops/issues/183/comments"},"review_comments":{"href":"https://api.github.com/repos/input-output-hk/iohk-ops/pulls/183/comments"},"review_comment":{"href":"https://api.github.com/repos/input-output-hk/iohk-ops/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/input-output-hk/iohk-ops/pulls/183/commits"},"statuses":{"href":"https://api.github.com/repos/input-output-hk/iohk-ops/statuses/8741ae67059ae9ed46b7aa414f8239ef27d92618"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"adinapoli-iohk"}}