{"action":"created","comment":{"url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/pulls/comments/69471044","id":69471044,"diff_hunk":"@@ -102,11 +121,38 @@ def _get_github():\n         ).format(project_root=PROJECT_ROOT)\n         username = raw_input('Github username: ')\n         password = getpass('Github password: ')\n-        return login(\n+        global_github = login(\n             username=username,\n             password=password,\n         )\n     else:\n-        return login(\n+        global_github = login(\n             token=GITHUB_APIKEY,\n         )\n+\n+    return global_github\n+\n+\n+def cache_deploy_state(command_index):\n+    with open(os.path.join(PROJECT_ROOT, CACHED_DEPLOY_CHECKPOINT_FILENAME), 'w') as f:\n+        pickle.dump(command_index, f)\n+    with open(os.path.join(PROJECT_ROOT, CACHED_DEPLOY_ENV_FILENAME), 'w') as f:\n+        pickle.dump(env, f)\n+\n+\n+def retrieve_cached_deploy_env():\n+    filename = os.path.join(PROJECT_ROOT, CACHED_DEPLOY_ENV_FILENAME)\n+    return _retrieve_cached(filename)\n+\n+\n+def retrieve_cached_deploy_checkpoint():\n+    filename = os.path.join(PROJECT_ROOT, CACHED_DEPLOY_CHECKPOINT_FILENAME)\n+    return _retrieve_cached(filename)","path":"fab/utils.py","position":119,"original_position":113,"commit_id":"82f13353ec38ccad2d35ab2503709e066e46a48f","original_commit_id":"9bb24ad76ba1d54f84ea4b0cb6a092e03caecba2","user":{"login":"esoergel","id":2367539,"avatar_url":"https://avatars.githubusercontent.com/u/2367539?v=3","gravatar_id":"","url":"https://api.github.com/users/esoergel","html_url":"https://github.com/esoergel","followers_url":"https://api.github.com/users/esoergel/followers","following_url":"https://api.github.com/users/esoergel/following{/other_user}","gists_url":"https://api.github.com/users/esoergel/gists{/gist_id}","starred_url":"https://api.github.com/users/esoergel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/esoergel/subscriptions","organizations_url":"https://api.github.com/users/esoergel/orgs","repos_url":"https://api.github.com/users/esoergel/repos","events_url":"https://api.github.com/users/esoergel/events{/privacy}","received_events_url":"https://api.github.com/users/esoergel/received_events","type":"User","site_admin":false},"body":"What if the file doesn't exist?","created_at":"2016-07-04T15:18:34Z","updated_at":"2016-07-04T15:18:34Z","html_url":"https://github.com/dimagi/commcare-hq-deploy/pull/62#discussion_r69471044","pull_request_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/pulls/62","_links":{"self":{"href":"https://api.github.com/repos/dimagi/commcare-hq-deploy/pulls/comments/69471044"},"html":{"href":"https://github.com/dimagi/commcare-hq-deploy/pull/62#discussion_r69471044"},"pull_request":{"href":"https://api.github.com/repos/dimagi/commcare-hq-deploy/pulls/62"}}},"pull_request":{"url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/pulls/62","id":76013583,"html_url":"https://github.com/dimagi/commcare-hq-deploy/pull/62","diff_url":"https://github.com/dimagi/commcare-hq-deploy/pull/62.diff","patch_url":"https://github.com/dimagi/commcare-hq-deploy/pull/62.patch","issue_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/issues/62","number":62,"state":"open","locked":false,"title":"Resume deploys","user":{"login":"benrudolph","id":918514,"avatar_url":"https://avatars.githubusercontent.com/u/918514?v=3","gravatar_id":"","url":"https://api.github.com/users/benrudolph","html_url":"https://github.com/benrudolph","followers_url":"https://api.github.com/users/benrudolph/followers","following_url":"https://api.github.com/users/benrudolph/following{/other_user}","gists_url":"https://api.github.com/users/benrudolph/gists{/gist_id}","starred_url":"https://api.github.com/users/benrudolph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benrudolph/subscriptions","organizations_url":"https://api.github.com/users/benrudolph/orgs","repos_url":"https://api.github.com/users/benrudolph/repos","events_url":"https://api.github.com/users/benrudolph/events{/privacy}","received_events_url":"https://api.github.com/users/benrudolph/received_events","type":"User","site_admin":false},"body":"@dannyroberts this gives you the ability to resume deploys if they've crashed. I went with using pickle instead of redis since it's easier to store complex objects with it.\r\n<img width=\"1551\" alt=\"screen shot 2016-07-01 at 1 35 11 pm\" src=\"https://cloud.githubusercontent.com/assets/918514/16529507/4f5cfdb6-3f91-11e6-9bc2-f6e4dfc01a0d.png\">\r\nbest read 🐟 but could probably be either since it's fairly small. note this is a PR that goes into https://github.com/dimagi/commcare-hq-deploy/pull/61\r\n\r\ncc: @proteusvacuum @sravfeyn ","created_at":"2016-07-01T17:40:38Z","updated_at":"2016-07-04T15:18:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8d1c5871898ce6298b469d4a34e1ca2ec6929f32","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/pulls/62/commits","review_comments_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/pulls/62/comments","review_comment_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/issues/62/comments","statuses_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/statuses/82f13353ec38ccad2d35ab2503709e066e46a48f","head":{"label":"dimagi:br/resume-deploys","ref":"br/resume-deploys","sha":"82f13353ec38ccad2d35ab2503709e066e46a48f","user":{"login":"dimagi","id":94514,"avatar_url":"https://avatars.githubusercontent.com/u/94514?v=3","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"repo":{"id":55796275,"name":"commcare-hq-deploy","full_name":"dimagi/commcare-hq-deploy","owner":{"login":"dimagi","id":94514,"avatar_url":"https://avatars.githubusercontent.com/u/94514?v=3","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dimagi/commcare-hq-deploy","description":"CommCareHQ's deploy files","fork":false,"url":"https://api.github.com/repos/dimagi/commcare-hq-deploy","forks_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/forks","keys_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/teams","hooks_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/hooks","issue_events_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/issues/events{/number}","events_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/events","assignees_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/assignees{/user}","branches_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/branches{/branch}","tags_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/tags","blobs_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/git/refs{/sha}","trees_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/statuses/{sha}","languages_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/languages","stargazers_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/stargazers","contributors_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/contributors","subscribers_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/subscribers","subscription_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/subscription","commits_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/commits{/sha}","git_commits_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/git/commits{/sha}","comments_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/comments{/number}","issue_comment_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/issues/comments{/number}","contents_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/contents/{+path}","compare_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/merges","archive_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/downloads","issues_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/issues{/number}","pulls_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/pulls{/number}","milestones_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/milestones{/number}","notifications_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/labels{/name}","releases_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/releases{/id}","deployments_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/deployments","created_at":"2016-04-08T17:10:21Z","updated_at":"2016-04-08T17:12:26Z","pushed_at":"2016-07-04T08:58:15Z","git_url":"git://github.com/dimagi/commcare-hq-deploy.git","ssh_url":"git@github.com:dimagi/commcare-hq-deploy.git","clone_url":"https://github.com/dimagi/commcare-hq-deploy.git","svn_url":"https://github.com/dimagi/commcare-hq-deploy","homepage":null,"size":516,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"dimagi:br/refactor-operations-2","ref":"br/refactor-operations-2","sha":"2ee89e639f572e454b8521bcff00cf83f1a73be3","user":{"login":"dimagi","id":94514,"avatar_url":"https://avatars.githubusercontent.com/u/94514?v=3","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"repo":{"id":55796275,"name":"commcare-hq-deploy","full_name":"dimagi/commcare-hq-deploy","owner":{"login":"dimagi","id":94514,"avatar_url":"https://avatars.githubusercontent.com/u/94514?v=3","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dimagi/commcare-hq-deploy","description":"CommCareHQ's deploy files","fork":false,"url":"https://api.github.com/repos/dimagi/commcare-hq-deploy","forks_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/forks","keys_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/teams","hooks_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/hooks","issue_events_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/issues/events{/number}","events_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/events","assignees_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/assignees{/user}","branches_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/branches{/branch}","tags_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/tags","blobs_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/git/refs{/sha}","trees_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/statuses/{sha}","languages_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/languages","stargazers_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/stargazers","contributors_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/contributors","subscribers_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/subscribers","subscription_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/subscription","commits_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/commits{/sha}","git_commits_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/git/commits{/sha}","comments_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/comments{/number}","issue_comment_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/issues/comments{/number}","contents_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/contents/{+path}","compare_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/merges","archive_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/downloads","issues_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/issues{/number}","pulls_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/pulls{/number}","milestones_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/milestones{/number}","notifications_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/labels{/name}","releases_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/releases{/id}","deployments_url":"https://api.github.com/repos/dimagi/commcare-hq-deploy/deployments","created_at":"2016-04-08T17:10:21Z","updated_at":"2016-04-08T17:12:26Z","pushed_at":"2016-07-04T08:58:15Z","git_url":"git://github.com/dimagi/commcare-hq-deploy.git","ssh_url":"git@github.com:dimagi/commcare-hq-deploy.git","clone_url":"https://github.com/dimagi/commcare-hq-deploy.git","svn_url":"https://github.com/dimagi/commcare-hq-deploy","homepage":null,"size":516,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dimagi/commcare-hq-deploy/pulls/62"},"html":{"href":"https://github.com/dimagi/commcare-hq-deploy/pull/62"},"issue":{"href":"https://api.github.com/repos/dimagi/commcare-hq-deploy/issues/62"},"comments":{"href":"https://api.github.com/repos/dimagi/commcare-hq-deploy/issues/62/comments"},"review_comments":{"href":"https://api.github.com/repos/dimagi/commcare-hq-deploy/pulls/62/comments"},"review_comment":{"href":"https://api.github.com/repos/dimagi/commcare-hq-deploy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dimagi/commcare-hq-deploy/pulls/62/commits"},"statuses":{"href":"https://api.github.com/repos/dimagi/commcare-hq-deploy/statuses/82f13353ec38ccad2d35ab2503709e066e46a48f"}}}}
{"actor":{"display_login":"esoergel"}}