{"action":"created","comment":{"url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/pulls/comments/35001306","id":35001306,"diff_hunk":"@@ -40,12 +45,26 @@ psql -c \"CREATE EXTENSION IF NOT EXISTS postgis;\"\n # Run migrations\n envdir /etc/mmw.d/env /opt/app/manage.py migrate\n \n-if [ \"$load_data\" = \"true\" ] ; then\n-\t# Fetch boundary layer sql files\n-\tFILE_HOST=\"https://s3.amazonaws.com/data.mmw.azavea.com\"\n-\tFILES=(\"boundary_huc12.sql.gz\" \"boundary_huc10.sql.gz\" \"boundary_huc08.sql.gz\")\n+function download_and_load {\n+    FILE_HOST=\"https://s3.amazonaws.com/data.mmw.azavea.com\"\n+\n+    for f in \"${FILES[@]}\"; do\n+        curl -s $FILE_HOST/$f | gunzip -q | psql --single-transaction\n+    done\n+\n+}\n+\n+if [ \"$load_boundary\" = \"true\" ] ; then\n+    # Fetch boundary layer sql files\n+    FILES=(\"boundary_huc12.sql.gz\" \"boundary_huc10.sql.gz\" \"boundary_huc08.sql.gz\")\n \n-\tfor f in \"${FILES[@]}\"; do\n-\t    curl -s $FILE_HOST/$f | gunzip -q | psql --single-transaction\n-\tdone\n+    download_and_load $FILES       ","path":"scripts/aws/setupdb.sh","position":60,"original_position":60,"commit_id":"e005cae1725f5843da83cb7e0473c78b2c46895b","original_commit_id":"e005cae1725f5843da83cb7e0473c78b2c46895b","user":{"login":"hectcastro","id":43639,"avatar_url":"https://avatars.githubusercontent.com/u/43639?v=3","gravatar_id":"","url":"https://api.github.com/users/hectcastro","html_url":"https://github.com/hectcastro","followers_url":"https://api.github.com/users/hectcastro/followers","following_url":"https://api.github.com/users/hectcastro/following{/other_user}","gists_url":"https://api.github.com/users/hectcastro/gists{/gist_id}","starred_url":"https://api.github.com/users/hectcastro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hectcastro/subscriptions","organizations_url":"https://api.github.com/users/hectcastro/orgs","repos_url":"https://api.github.com/users/hectcastro/repos","events_url":"https://api.github.com/users/hectcastro/events{/privacy}","received_events_url":"https://api.github.com/users/hectcastro/received_events","type":"User","site_admin":false},"body":"Some trailing spaces showing up in my editor after `$FILES`.","created_at":"2015-07-20T14:40:38Z","updated_at":"2015-07-20T14:40:38Z","html_url":"https://github.com/WikiWatershed/model-my-watershed/pull/590#discussion_r35001306","pull_request_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/pulls/590","_links":{"self":{"href":"https://api.github.com/repos/WikiWatershed/model-my-watershed/pulls/comments/35001306"},"html":{"href":"https://github.com/WikiWatershed/model-my-watershed/pull/590#discussion_r35001306"},"pull_request":{"href":"https://api.github.com/repos/WikiWatershed/model-my-watershed/pulls/590"}}},"pull_request":{"url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/pulls/590","id":40265368,"html_url":"https://github.com/WikiWatershed/model-my-watershed/pull/590","diff_url":"https://github.com/WikiWatershed/model-my-watershed/pull/590.diff","patch_url":"https://github.com/WikiWatershed/model-my-watershed/pull/590.patch","issue_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/issues/590","number":590,"state":"open","locked":false,"title":"Load stream data","user":{"login":"mmcfarland","id":1014341,"avatar_url":"https://avatars.githubusercontent.com/u/1014341?v=3","gravatar_id":"","url":"https://api.github.com/users/mmcfarland","html_url":"https://github.com/mmcfarland","followers_url":"https://api.github.com/users/mmcfarland/followers","following_url":"https://api.github.com/users/mmcfarland/following{/other_user}","gists_url":"https://api.github.com/users/mmcfarland/gists{/gist_id}","starred_url":"https://api.github.com/users/mmcfarland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmcfarland/subscriptions","organizations_url":"https://api.github.com/users/mmcfarland/orgs","repos_url":"https://api.github.com/users/mmcfarland/repos","events_url":"https://api.github.com/users/mmcfarland/events{/privacy}","received_events_url":"https://api.github.com/users/mmcfarland/received_events","type":"User","site_admin":false},"body":"Updates to the load script to load the stream network data.\r\n\r\nTo test, from an app server run:\r\n\r\n`./setupdb.sh -s` to load the stream network\r\n\r\nverify that\r\n`./setupdb.sh -b` will load the boundary data\r\n\r\nUltimately, the stream network should be visible in the Delaware River Basin.\r\n\r\nConnects #581 \r\n\r\ncc/ @hectcastro ","created_at":"2015-07-17T19:49:52Z","updated_at":"2015-07-20T14:40:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e745cfdcd367fc417687f86dd7a989d0be4750ce","assignee":{"login":"lewfish","id":1896461,"avatar_url":"https://avatars.githubusercontent.com/u/1896461?v=3","gravatar_id":"","url":"https://api.github.com/users/lewfish","html_url":"https://github.com/lewfish","followers_url":"https://api.github.com/users/lewfish/followers","following_url":"https://api.github.com/users/lewfish/following{/other_user}","gists_url":"https://api.github.com/users/lewfish/gists{/gist_id}","starred_url":"https://api.github.com/users/lewfish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lewfish/subscriptions","organizations_url":"https://api.github.com/users/lewfish/orgs","repos_url":"https://api.github.com/users/lewfish/repos","events_url":"https://api.github.com/users/lewfish/events{/privacy}","received_events_url":"https://api.github.com/users/lewfish/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/pulls/590/commits","review_comments_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/pulls/590/comments","review_comment_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/pulls/comments{/number}","comments_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/issues/590/comments","statuses_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/statuses/e005cae1725f5843da83cb7e0473c78b2c46895b","head":{"label":"mmcfarland:feature/load-stream-data","ref":"feature/load-stream-data","sha":"e005cae1725f5843da83cb7e0473c78b2c46895b","user":{"login":"mmcfarland","id":1014341,"avatar_url":"https://avatars.githubusercontent.com/u/1014341?v=3","gravatar_id":"","url":"https://api.github.com/users/mmcfarland","html_url":"https://github.com/mmcfarland","followers_url":"https://api.github.com/users/mmcfarland/followers","following_url":"https://api.github.com/users/mmcfarland/following{/other_user}","gists_url":"https://api.github.com/users/mmcfarland/gists{/gist_id}","starred_url":"https://api.github.com/users/mmcfarland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmcfarland/subscriptions","organizations_url":"https://api.github.com/users/mmcfarland/orgs","repos_url":"https://api.github.com/users/mmcfarland/repos","events_url":"https://api.github.com/users/mmcfarland/events{/privacy}","received_events_url":"https://api.github.com/users/mmcfarland/received_events","type":"User","site_admin":false},"repo":{"id":36315791,"name":"model-my-watershed","full_name":"mmcfarland/model-my-watershed","owner":{"login":"mmcfarland","id":1014341,"avatar_url":"https://avatars.githubusercontent.com/u/1014341?v=3","gravatar_id":"","url":"https://api.github.com/users/mmcfarland","html_url":"https://github.com/mmcfarland","followers_url":"https://api.github.com/users/mmcfarland/followers","following_url":"https://api.github.com/users/mmcfarland/following{/other_user}","gists_url":"https://api.github.com/users/mmcfarland/gists{/gist_id}","starred_url":"https://api.github.com/users/mmcfarland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmcfarland/subscriptions","organizations_url":"https://api.github.com/users/mmcfarland/orgs","repos_url":"https://api.github.com/users/mmcfarland/repos","events_url":"https://api.github.com/users/mmcfarland/events{/privacy}","received_events_url":"https://api.github.com/users/mmcfarland/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mmcfarland/model-my-watershed","description":"The web application front end for Model My Watershed.","fork":true,"url":"https://api.github.com/repos/mmcfarland/model-my-watershed","forks_url":"https://api.github.com/repos/mmcfarland/model-my-watershed/forks","keys_url":"https://api.github.com/repos/mmcfarland/model-my-watershed/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mmcfarland/model-my-watershed/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mmcfarland/model-my-watershed/teams","hooks_url":"https://api.github.com/repos/mmcfarland/model-my-watershed/hooks","issue_events_url":"https://api.github.com/repos/mmcfarland/model-my-watershed/issues/events{/number}","events_url":"https://api.github.com/repos/mmcfarland/model-my-watershed/events","assignees_url":"https://api.github.com/repos/mmcfarland/model-my-watershed/assignees{/user}","branches_url":"https://api.github.com/repos/mmcfarland/model-my-watershed/branches{/branch}","tags_url":"https://api.github.com/repos/mmcfarland/model-my-watershed/tags","blobs_url":"https://api.github.com/repos/mmcfarland/model-my-watershed/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mmcfarland/model-my-watershed/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mmcfarland/model-my-watershed/git/refs{/sha}","trees_url":"https://api.github.com/repos/mmcfarland/model-my-watershed/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mmcfarland/model-my-watershed/statuses/{sha}","languages_url":"https://api.github.com/repos/mmcfarland/model-my-watershed/languages","stargazers_url":"https://api.github.com/repos/mmcfarland/model-my-watershed/stargazers","contributors_url":"https://api.github.com/repos/mmcfarland/model-my-watershed/contributors","subscribers_url":"https://api.github.com/repos/mmcfarland/model-my-watershed/subscribers","subscription_url":"https://api.github.com/repos/mmcfarland/model-my-watershed/subscription","commits_url":"https://api.github.com/repos/mmcfarland/model-my-watershed/commits{/sha}","git_commits_url":"https://api.github.com/repos/mmcfarland/model-my-watershed/git/commits{/sha}","comments_url":"https://api.github.com/repos/mmcfarland/model-my-watershed/comments{/number}","issue_comment_url":"https://api.github.com/repos/mmcfarland/model-my-watershed/issues/comments{/number}","contents_url":"https://api.github.com/repos/mmcfarland/model-my-watershed/contents/{+path}","compare_url":"https://api.github.com/repos/mmcfarland/model-my-watershed/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mmcfarland/model-my-watershed/merges","archive_url":"https://api.github.com/repos/mmcfarland/model-my-watershed/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mmcfarland/model-my-watershed/downloads","issues_url":"https://api.github.com/repos/mmcfarland/model-my-watershed/issues{/number}","pulls_url":"https://api.github.com/repos/mmcfarland/model-my-watershed/pulls{/number}","milestones_url":"https://api.github.com/repos/mmcfarland/model-my-watershed/milestones{/number}","notifications_url":"https://api.github.com/repos/mmcfarland/model-my-watershed/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mmcfarland/model-my-watershed/labels{/name}","releases_url":"https://api.github.com/repos/mmcfarland/model-my-watershed/releases{/id}","created_at":"2015-05-26T18:32:16Z","updated_at":"2015-06-11T21:05:42Z","pushed_at":"2015-07-17T19:47:12Z","git_url":"git://github.com/mmcfarland/model-my-watershed.git","ssh_url":"git@github.com:mmcfarland/model-my-watershed.git","clone_url":"https://github.com/mmcfarland/model-my-watershed.git","svn_url":"https://github.com/mmcfarland/model-my-watershed","homepage":null,"size":13995,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"WikiWatershed:develop","ref":"develop","sha":"84fe4e15c26e8450616218acdef585c34e8744e8","user":{"login":"WikiWatershed","id":8520008,"avatar_url":"https://avatars.githubusercontent.com/u/8520008?v=3","gravatar_id":"","url":"https://api.github.com/users/WikiWatershed","html_url":"https://github.com/WikiWatershed","followers_url":"https://api.github.com/users/WikiWatershed/followers","following_url":"https://api.github.com/users/WikiWatershed/following{/other_user}","gists_url":"https://api.github.com/users/WikiWatershed/gists{/gist_id}","starred_url":"https://api.github.com/users/WikiWatershed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WikiWatershed/subscriptions","organizations_url":"https://api.github.com/users/WikiWatershed/orgs","repos_url":"https://api.github.com/users/WikiWatershed/repos","events_url":"https://api.github.com/users/WikiWatershed/events{/privacy}","received_events_url":"https://api.github.com/users/WikiWatershed/received_events","type":"Organization","site_admin":false},"repo":{"id":32742922,"name":"model-my-watershed","full_name":"WikiWatershed/model-my-watershed","owner":{"login":"WikiWatershed","id":8520008,"avatar_url":"https://avatars.githubusercontent.com/u/8520008?v=3","gravatar_id":"","url":"https://api.github.com/users/WikiWatershed","html_url":"https://github.com/WikiWatershed","followers_url":"https://api.github.com/users/WikiWatershed/followers","following_url":"https://api.github.com/users/WikiWatershed/following{/other_user}","gists_url":"https://api.github.com/users/WikiWatershed/gists{/gist_id}","starred_url":"https://api.github.com/users/WikiWatershed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WikiWatershed/subscriptions","organizations_url":"https://api.github.com/users/WikiWatershed/orgs","repos_url":"https://api.github.com/users/WikiWatershed/repos","events_url":"https://api.github.com/users/WikiWatershed/events{/privacy}","received_events_url":"https://api.github.com/users/WikiWatershed/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WikiWatershed/model-my-watershed","description":"The web application front end for Model My Watershed.","fork":false,"url":"https://api.github.com/repos/WikiWatershed/model-my-watershed","forks_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/forks","keys_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/teams","hooks_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/hooks","issue_events_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/issues/events{/number}","events_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/events","assignees_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/assignees{/user}","branches_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/branches{/branch}","tags_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/tags","blobs_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/git/refs{/sha}","trees_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/statuses/{sha}","languages_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/languages","stargazers_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/stargazers","contributors_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/contributors","subscribers_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/subscribers","subscription_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/subscription","commits_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/commits{/sha}","git_commits_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/git/commits{/sha}","comments_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/comments{/number}","issue_comment_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/issues/comments{/number}","contents_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/contents/{+path}","compare_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/merges","archive_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/downloads","issues_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/issues{/number}","pulls_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/pulls{/number}","milestones_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/milestones{/number}","notifications_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/labels{/name}","releases_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/releases{/id}","created_at":"2015-03-23T16:02:55Z","updated_at":"2015-07-16T03:33:25Z","pushed_at":"2015-07-20T14:30:51Z","git_url":"git://github.com/WikiWatershed/model-my-watershed.git","ssh_url":"git@github.com:WikiWatershed/model-my-watershed.git","clone_url":"https://github.com/WikiWatershed/model-my-watershed.git","svn_url":"https://github.com/WikiWatershed/model-my-watershed","homepage":null,"size":17285,"stargazers_count":3,"watchers_count":3,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":109,"forks":10,"open_issues":109,"watchers":3,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/WikiWatershed/model-my-watershed/pulls/590"},"html":{"href":"https://github.com/WikiWatershed/model-my-watershed/pull/590"},"issue":{"href":"https://api.github.com/repos/WikiWatershed/model-my-watershed/issues/590"},"comments":{"href":"https://api.github.com/repos/WikiWatershed/model-my-watershed/issues/590/comments"},"review_comments":{"href":"https://api.github.com/repos/WikiWatershed/model-my-watershed/pulls/590/comments"},"review_comment":{"href":"https://api.github.com/repos/WikiWatershed/model-my-watershed/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/WikiWatershed/model-my-watershed/pulls/590/commits"},"statuses":{"href":"https://api.github.com/repos/WikiWatershed/model-my-watershed/statuses/e005cae1725f5843da83cb7e0473c78b2c46895b"}}}}