{"action":"created","comment":{"url":"https://api.github.com/repos/daniellealexis/enkii/pulls/comments/141428036","pull_request_review_id":65640509,"id":141428036,"diff_hunk":"@@ -0,0 +1,175 @@\n+from __future__ import with_statement\n+from fabric.api import local, settings, abort, run, cd, env, put\n+from fabric.contrib.console import confirm\n+import os\n+import fnmatch\n+import tarfile\n+import tempfile\n+\n+#TODO: break this into multiple files and add to deploy directory\n+#TODO: add gitignore processing when file is encountered (this will clean up the excludes list) https://github.com/tsileo/dirtools\n+\n+dest_dir = '/var/www'\n+env.hosts = ['enkii.net']\n+env.user = 'ubuntu'\n+env.key_filename = './enkii.pem'\n+\n+excludes = (\n+    env.key_filename,\n+    './.vagrant',\n+    '.git',\n+    './node_modules',\n+    './tests',\n+    './vendor',\n+    '.env',\n+    '.env.example',\n+    '.gitattributes',\n+    '.gitignore',\n+    '*/fabfile.*',\n+    'package.json',\n+    'phpunit.xml',\n+    'Procfile',\n+    'README.md',\n+    'Vagrantfile',\n+    'webpack.mix.js',\n+    'yarn.lock',\n+    './public/hot',\n+    './public/storage',\n+    './storage/*.key',\n+    './.idea',\n+    'Homestead.json',\n+    'Homestead.yaml',\n+    'npm-debug.log',\n+    'yarn-error.log',\n+    'npm-debug.log',\n+    'dani_notes.txt',\n+    '.DS_Store',\n+    './bootstrap/cache/*',\n+    './database/*.sqlite',\n+    './public/mix-manifest.json',\n+    './storage/app/*',\n+    './storage/app/public/*',\n+    './storage/framework/config.php',\n+    './storage/framework/routes.php',\n+    './storage/framework/schedule-*',\n+    './storage/framework/compiled.php',\n+    './storage/framework/services.json',\n+    './storage/framework/events.scanned.php',\n+    './storage/framework/routes.scanned.php',\n+    './storage/framework/down',\n+    './storage/framework/cache/*',\n+    './storage/framework/sessions/*',\n+    './storage/framework/testing/*',\n+    './storage/framework/views/*',\n+    './storage/logs/*'\n+)\n+\n+def _check_filter(filter, full_path):\n+    ret = (filter in full_path)\n+    if '*' in filter:\n+        ret = ret | fnmatch.fnmatch(full_path, filter)\n+\n+    return ret\n+\n+# new method to filter\n+# def _check_filter(info):\n+#     name = './' + info.name\n+#     ret = False\n+#     for filter in excludes:\n+#         ret = (filter in name)\n+#         if '*' in filter:\n+#             ret = ret | fnmatch.fnmatch(name, filter)\n+#         if ret:\n+#             info = None\n+#             break\n+#\n+#     return info\n+\n+def build(type='prod'):\n+    \"\"\"\n+    Compile assets into the public directory\n+\n+    Keyword arguments:\n+    type -- environment to build, dev or prod (default prod)\n+    \"\"\"\n+    if type != 'prod' and type != 'dev':\n+        print 'must specify either dev or prod'\n+        return False\n+\n+    local('npm run ' + type)\n+    return True\n+\n+def deploy(type='prod', do_migrate=False):\n+    \"\"\"\n+    Compile assets, copy files to server and optionally run migrations\n+\n+    Keyword arguments:\n+    type         -- environment to build, dev or prod (default prod)\n+    do_migration -- run the database migrations (default False)\n+    \"\"\"\n+    if not build(type):\n+        return\n+\n+    # newer way of doing this, cleaner but slower... too slow for me\n+    # with tarfile.open('test.tar', mode='w') as out:\n+    #     for root, subdirs, files in os.walk('.', topdown=True):\n+    #         new_root = ''\n+    #         if root != '.' and root != './':\n+    #             new_root = os.path.normpath(root)\n+    #             out.add(new_root, recursive=False, filter=_check_filter)\n+    #         for file in files:\n+    #             out.add(os.path.join(new_root, file), filter=_check_filter)\n+\n+    temp_file = ''\n+    try:\n+        temp_file = os.path.join(tempfile._get_default_tempdir(), next(tempfile._get_candidate_names()))\n+        # doing it this way because it's faster!!! SPEED BABY SPEED!!!","path":"fabfile.py","position":126,"original_position":126,"commit_id":"c6fbe0a3e5680530ac399cd6a6788b4721cd1586","original_commit_id":"c6fbe0a3e5680530ac399cd6a6788b4721cd1586","user":{"login":"daniellealexis","id":8729338,"avatar_url":"https://avatars0.githubusercontent.com/u/8729338?v=4","gravatar_id":"","url":"https://api.github.com/users/daniellealexis","html_url":"https://github.com/daniellealexis","followers_url":"https://api.github.com/users/daniellealexis/followers","following_url":"https://api.github.com/users/daniellealexis/following{/other_user}","gists_url":"https://api.github.com/users/daniellealexis/gists{/gist_id}","starred_url":"https://api.github.com/users/daniellealexis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daniellealexis/subscriptions","organizations_url":"https://api.github.com/users/daniellealexis/orgs","repos_url":"https://api.github.com/users/daniellealexis/repos","events_url":"https://api.github.com/users/daniellealexis/events{/privacy}","received_events_url":"https://api.github.com/users/daniellealexis/received_events","type":"User","site_admin":false},"body":"hehehe","created_at":"2017-09-27T18:24:06Z","updated_at":"2017-09-27T18:25:17Z","html_url":"https://github.com/daniellealexis/enkii/pull/26#discussion_r141428036","pull_request_url":"https://api.github.com/repos/daniellealexis/enkii/pulls/26","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/daniellealexis/enkii/pulls/comments/141428036"},"html":{"href":"https://github.com/daniellealexis/enkii/pull/26#discussion_r141428036"},"pull_request":{"href":"https://api.github.com/repos/daniellealexis/enkii/pulls/26"}}},"pull_request":{"url":"https://api.github.com/repos/daniellealexis/enkii/pulls/26","id":143233742,"html_url":"https://github.com/daniellealexis/enkii/pull/26","diff_url":"https://github.com/daniellealexis/enkii/pull/26.diff","patch_url":"https://github.com/daniellealexis/enkii/pull/26.patch","issue_url":"https://api.github.com/repos/daniellealexis/enkii/issues/26","number":26,"state":"open","locked":false,"title":"New deploy script WOOHOO!!!!","user":{"login":"akusei","id":12972900,"avatar_url":"https://avatars3.githubusercontent.com/u/12972900?v=4","gravatar_id":"","url":"https://api.github.com/users/akusei","html_url":"https://github.com/akusei","followers_url":"https://api.github.com/users/akusei/followers","following_url":"https://api.github.com/users/akusei/following{/other_user}","gists_url":"https://api.github.com/users/akusei/gists{/gist_id}","starred_url":"https://api.github.com/users/akusei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akusei/subscriptions","organizations_url":"https://api.github.com/users/akusei/orgs","repos_url":"https://api.github.com/users/akusei/repos","events_url":"https://api.github.com/users/akusei/events{/privacy}","received_events_url":"https://api.github.com/users/akusei/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-09-26T20:23:09Z","updated_at":"2017-09-27T18:25:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d6dc5b625408c1897e22b365a591bd25d9f1258a","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/daniellealexis/enkii/pulls/26/commits","review_comments_url":"https://api.github.com/repos/daniellealexis/enkii/pulls/26/comments","review_comment_url":"https://api.github.com/repos/daniellealexis/enkii/pulls/comments{/number}","comments_url":"https://api.github.com/repos/daniellealexis/enkii/issues/26/comments","statuses_url":"https://api.github.com/repos/daniellealexis/enkii/statuses/c6fbe0a3e5680530ac399cd6a6788b4721cd1586","head":{"label":"daniellealexis:deploy-script","ref":"deploy-script","sha":"c6fbe0a3e5680530ac399cd6a6788b4721cd1586","user":{"login":"daniellealexis","id":8729338,"avatar_url":"https://avatars0.githubusercontent.com/u/8729338?v=4","gravatar_id":"","url":"https://api.github.com/users/daniellealexis","html_url":"https://github.com/daniellealexis","followers_url":"https://api.github.com/users/daniellealexis/followers","following_url":"https://api.github.com/users/daniellealexis/following{/other_user}","gists_url":"https://api.github.com/users/daniellealexis/gists{/gist_id}","starred_url":"https://api.github.com/users/daniellealexis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daniellealexis/subscriptions","organizations_url":"https://api.github.com/users/daniellealexis/orgs","repos_url":"https://api.github.com/users/daniellealexis/repos","events_url":"https://api.github.com/users/daniellealexis/events{/privacy}","received_events_url":"https://api.github.com/users/daniellealexis/received_events","type":"User","site_admin":false},"repo":{"id":89884217,"name":"enkii","full_name":"daniellealexis/enkii","owner":{"login":"daniellealexis","id":8729338,"avatar_url":"https://avatars0.githubusercontent.com/u/8729338?v=4","gravatar_id":"","url":"https://api.github.com/users/daniellealexis","html_url":"https://github.com/daniellealexis","followers_url":"https://api.github.com/users/daniellealexis/followers","following_url":"https://api.github.com/users/daniellealexis/following{/other_user}","gists_url":"https://api.github.com/users/daniellealexis/gists{/gist_id}","starred_url":"https://api.github.com/users/daniellealexis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daniellealexis/subscriptions","organizations_url":"https://api.github.com/users/daniellealexis/orgs","repos_url":"https://api.github.com/users/daniellealexis/repos","events_url":"https://api.github.com/users/daniellealexis/events{/privacy}","received_events_url":"https://api.github.com/users/daniellealexis/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/daniellealexis/enkii","description":null,"fork":false,"url":"https://api.github.com/repos/daniellealexis/enkii","forks_url":"https://api.github.com/repos/daniellealexis/enkii/forks","keys_url":"https://api.github.com/repos/daniellealexis/enkii/keys{/key_id}","collaborators_url":"https://api.github.com/repos/daniellealexis/enkii/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/daniellealexis/enkii/teams","hooks_url":"https://api.github.com/repos/daniellealexis/enkii/hooks","issue_events_url":"https://api.github.com/repos/daniellealexis/enkii/issues/events{/number}","events_url":"https://api.github.com/repos/daniellealexis/enkii/events","assignees_url":"https://api.github.com/repos/daniellealexis/enkii/assignees{/user}","branches_url":"https://api.github.com/repos/daniellealexis/enkii/branches{/branch}","tags_url":"https://api.github.com/repos/daniellealexis/enkii/tags","blobs_url":"https://api.github.com/repos/daniellealexis/enkii/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/daniellealexis/enkii/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/daniellealexis/enkii/git/refs{/sha}","trees_url":"https://api.github.com/repos/daniellealexis/enkii/git/trees{/sha}","statuses_url":"https://api.github.com/repos/daniellealexis/enkii/statuses/{sha}","languages_url":"https://api.github.com/repos/daniellealexis/enkii/languages","stargazers_url":"https://api.github.com/repos/daniellealexis/enkii/stargazers","contributors_url":"https://api.github.com/repos/daniellealexis/enkii/contributors","subscribers_url":"https://api.github.com/repos/daniellealexis/enkii/subscribers","subscription_url":"https://api.github.com/repos/daniellealexis/enkii/subscription","commits_url":"https://api.github.com/repos/daniellealexis/enkii/commits{/sha}","git_commits_url":"https://api.github.com/repos/daniellealexis/enkii/git/commits{/sha}","comments_url":"https://api.github.com/repos/daniellealexis/enkii/comments{/number}","issue_comment_url":"https://api.github.com/repos/daniellealexis/enkii/issues/comments{/number}","contents_url":"https://api.github.com/repos/daniellealexis/enkii/contents/{+path}","compare_url":"https://api.github.com/repos/daniellealexis/enkii/compare/{base}...{head}","merges_url":"https://api.github.com/repos/daniellealexis/enkii/merges","archive_url":"https://api.github.com/repos/daniellealexis/enkii/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/daniellealexis/enkii/downloads","issues_url":"https://api.github.com/repos/daniellealexis/enkii/issues{/number}","pulls_url":"https://api.github.com/repos/daniellealexis/enkii/pulls{/number}","milestones_url":"https://api.github.com/repos/daniellealexis/enkii/milestones{/number}","notifications_url":"https://api.github.com/repos/daniellealexis/enkii/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/daniellealexis/enkii/labels{/name}","releases_url":"https://api.github.com/repos/daniellealexis/enkii/releases{/id}","deployments_url":"https://api.github.com/repos/daniellealexis/enkii/deployments","created_at":"2017-04-30T23:50:08Z","updated_at":"2017-04-30T23:50:56Z","pushed_at":"2017-09-26T20:23:09Z","git_url":"git://github.com/daniellealexis/enkii.git","ssh_url":"git@github.com:daniellealexis/enkii.git","clone_url":"https://github.com/daniellealexis/enkii.git","svn_url":"https://github.com/daniellealexis/enkii","homepage":null,"size":853,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"daniellealexis:master","ref":"master","sha":"d1b770db305744714e802494704117b91731fec9","user":{"login":"daniellealexis","id":8729338,"avatar_url":"https://avatars0.githubusercontent.com/u/8729338?v=4","gravatar_id":"","url":"https://api.github.com/users/daniellealexis","html_url":"https://github.com/daniellealexis","followers_url":"https://api.github.com/users/daniellealexis/followers","following_url":"https://api.github.com/users/daniellealexis/following{/other_user}","gists_url":"https://api.github.com/users/daniellealexis/gists{/gist_id}","starred_url":"https://api.github.com/users/daniellealexis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daniellealexis/subscriptions","organizations_url":"https://api.github.com/users/daniellealexis/orgs","repos_url":"https://api.github.com/users/daniellealexis/repos","events_url":"https://api.github.com/users/daniellealexis/events{/privacy}","received_events_url":"https://api.github.com/users/daniellealexis/received_events","type":"User","site_admin":false},"repo":{"id":89884217,"name":"enkii","full_name":"daniellealexis/enkii","owner":{"login":"daniellealexis","id":8729338,"avatar_url":"https://avatars0.githubusercontent.com/u/8729338?v=4","gravatar_id":"","url":"https://api.github.com/users/daniellealexis","html_url":"https://github.com/daniellealexis","followers_url":"https://api.github.com/users/daniellealexis/followers","following_url":"https://api.github.com/users/daniellealexis/following{/other_user}","gists_url":"https://api.github.com/users/daniellealexis/gists{/gist_id}","starred_url":"https://api.github.com/users/daniellealexis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daniellealexis/subscriptions","organizations_url":"https://api.github.com/users/daniellealexis/orgs","repos_url":"https://api.github.com/users/daniellealexis/repos","events_url":"https://api.github.com/users/daniellealexis/events{/privacy}","received_events_url":"https://api.github.com/users/daniellealexis/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/daniellealexis/enkii","description":null,"fork":false,"url":"https://api.github.com/repos/daniellealexis/enkii","forks_url":"https://api.github.com/repos/daniellealexis/enkii/forks","keys_url":"https://api.github.com/repos/daniellealexis/enkii/keys{/key_id}","collaborators_url":"https://api.github.com/repos/daniellealexis/enkii/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/daniellealexis/enkii/teams","hooks_url":"https://api.github.com/repos/daniellealexis/enkii/hooks","issue_events_url":"https://api.github.com/repos/daniellealexis/enkii/issues/events{/number}","events_url":"https://api.github.com/repos/daniellealexis/enkii/events","assignees_url":"https://api.github.com/repos/daniellealexis/enkii/assignees{/user}","branches_url":"https://api.github.com/repos/daniellealexis/enkii/branches{/branch}","tags_url":"https://api.github.com/repos/daniellealexis/enkii/tags","blobs_url":"https://api.github.com/repos/daniellealexis/enkii/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/daniellealexis/enkii/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/daniellealexis/enkii/git/refs{/sha}","trees_url":"https://api.github.com/repos/daniellealexis/enkii/git/trees{/sha}","statuses_url":"https://api.github.com/repos/daniellealexis/enkii/statuses/{sha}","languages_url":"https://api.github.com/repos/daniellealexis/enkii/languages","stargazers_url":"https://api.github.com/repos/daniellealexis/enkii/stargazers","contributors_url":"https://api.github.com/repos/daniellealexis/enkii/contributors","subscribers_url":"https://api.github.com/repos/daniellealexis/enkii/subscribers","subscription_url":"https://api.github.com/repos/daniellealexis/enkii/subscription","commits_url":"https://api.github.com/repos/daniellealexis/enkii/commits{/sha}","git_commits_url":"https://api.github.com/repos/daniellealexis/enkii/git/commits{/sha}","comments_url":"https://api.github.com/repos/daniellealexis/enkii/comments{/number}","issue_comment_url":"https://api.github.com/repos/daniellealexis/enkii/issues/comments{/number}","contents_url":"https://api.github.com/repos/daniellealexis/enkii/contents/{+path}","compare_url":"https://api.github.com/repos/daniellealexis/enkii/compare/{base}...{head}","merges_url":"https://api.github.com/repos/daniellealexis/enkii/merges","archive_url":"https://api.github.com/repos/daniellealexis/enkii/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/daniellealexis/enkii/downloads","issues_url":"https://api.github.com/repos/daniellealexis/enkii/issues{/number}","pulls_url":"https://api.github.com/repos/daniellealexis/enkii/pulls{/number}","milestones_url":"https://api.github.com/repos/daniellealexis/enkii/milestones{/number}","notifications_url":"https://api.github.com/repos/daniellealexis/enkii/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/daniellealexis/enkii/labels{/name}","releases_url":"https://api.github.com/repos/daniellealexis/enkii/releases{/id}","deployments_url":"https://api.github.com/repos/daniellealexis/enkii/deployments","created_at":"2017-04-30T23:50:08Z","updated_at":"2017-04-30T23:50:56Z","pushed_at":"2017-09-26T20:23:09Z","git_url":"git://github.com/daniellealexis/enkii.git","ssh_url":"git@github.com:daniellealexis/enkii.git","clone_url":"https://github.com/daniellealexis/enkii.git","svn_url":"https://github.com/daniellealexis/enkii","homepage":null,"size":853,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/daniellealexis/enkii/pulls/26"},"html":{"href":"https://github.com/daniellealexis/enkii/pull/26"},"issue":{"href":"https://api.github.com/repos/daniellealexis/enkii/issues/26"},"comments":{"href":"https://api.github.com/repos/daniellealexis/enkii/issues/26/comments"},"review_comments":{"href":"https://api.github.com/repos/daniellealexis/enkii/pulls/26/comments"},"review_comment":{"href":"https://api.github.com/repos/daniellealexis/enkii/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/daniellealexis/enkii/pulls/26/commits"},"statuses":{"href":"https://api.github.com/repos/daniellealexis/enkii/statuses/c6fbe0a3e5680530ac399cd6a6788b4721cd1586"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"daniellealexis"}}